MSMK Posted August 13, 2021 Share Posted August 13, 2021 Всем привет! Подскажите как сделать, чтоб кнопка в гриде отображалась по определенному условию, в зависимости от значения в dataset. Например кнопку отображать, если Length >= 50, а в других случаях не отображать Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 13, 2021 Share Posted August 13, 2021 Добрый день, Этот пост может Вам помочь: Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 13, 2021 Author Share Posted August 13, 2021 3 minutes ago, Sherzod said: Добрый день, Этот пост может Вам помочь: спасибо Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 13, 2021 Author Share Posted August 13, 2021 39 minutes ago, Sherzod said: Добрый день, Этот пост может Вам помочь: использовал такую конструкцию, висит маска загрузки и не исчезает Grid - WidgetColumn2.zip function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { var widgetColIndx=1; columns[widgetColIndx].onWidgetAttach = function(column, widget, record) { if (record.get(widgetColIndx) == "Blue Angelfish") { widget.setvisible(true); } else { widget.setvisible(false); }; }; } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 13, 2021 Share Posted August 13, 2021 1 hour ago, =GGG= said: использовал такую конструкцию, висит маска загрузки и не исчезает Grid - WidgetColumn2.zip Я постараюсь проанализировать. Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 13, 2021 Author Share Posted August 13, 2021 1 minute ago, Sherzod said: Я постараюсь проанализировать. Спасибо! Жду Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 13, 2021 Share Posted August 13, 2021 8 hours ago, =GGG= said: Grid - WidgetColumn2.zip setvisible - setVisible 1 Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 14, 2021 Author Share Posted August 14, 2021 8 hours ago, Sherzod said: setvisible - setVisible ооох уж эти регистрозависимые языки Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 14, 2021 Author Share Posted August 14, 2021 8 hours ago, Sherzod said: setvisible - setVisible спасибо Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 14, 2021 Author Share Posted August 14, 2021 10 hours ago, Sherzod said: setvisible - setVisible у меня поле например типа Boolean я пишу widget.setVisible(record.get(widgetColIndx));, так как record.get(widgetColIndx) возвращает true или false. Почему то так не работает. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 14, 2021 Share Posted August 14, 2021 49 minutes ago, =GGG= said: у меня поле например типа Boolean В тестовом случае, boolean тип, чтобы проверить!? Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 14, 2021 Author Share Posted August 14, 2021 4 minutes ago, Sherzod said: В тестовом случае, boolean тип, чтобы проверить!? Я понял почему такие проблемы, в событии OnFieldImage я перетираю значение иконкой и в дальнейшем идет сравнение объекта Image c Boolean Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 14, 2021 Share Posted August 14, 2021 37 minutes ago, =GGG= said: Я понял почему такие проблемы, в событии OnFieldImage я перетираю значение иконкой и в дальнейшем идет сравнение объекта Image c Boolean Проблема решена? Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 14, 2021 Author Share Posted August 14, 2021 4 minutes ago, Sherzod said: Проблема решена? частично, иконки режет на кнопке. Не помещаются нормально Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 14, 2021 Author Share Posted August 14, 2021 15 minutes ago, Sherzod said: Проблема решена? Вот так режет иконку Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 14, 2021 Author Share Posted August 14, 2021 Just now, =GGG= said: Вот так режет иконку вот так должно быть Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 14, 2021 Share Posted August 14, 2021 Создайте скрытый столбец... Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 14, 2021 Author Share Posted August 14, 2021 Just now, Sherzod said: Создайте скрытый столбец... как раз этим занимаюсь, скоро скину Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 14, 2021 Author Share Posted August 14, 2021 тестовый проект testWidget.zip. Отображать кнопки при значениях равным 1. Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 14, 2021 Author Share Posted August 14, 2021 Just now, =GGG= said: тестовый проект testWidget.zip. Отображать кнопки при значениях равным 1. как в столбце customVariant скрыть кнопки без иконок? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 14, 2021 Share Posted August 14, 2021 Создайте скрытый столбец... Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 14, 2021 Author Share Posted August 14, 2021 4 minutes ago, Sherzod said: Создайте скрытый столбец... не понял Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 14, 2021 Share Posted August 14, 2021 12 minutes ago, =GGG= said: 17 minutes ago, Sherzod said: Создайте скрытый столбец... не понял Простите, пост продублировался. Quote Link to comment Share on other sites More sharing options...
MSMK Posted August 14, 2021 Author Share Posted August 14, 2021 Just now, Sherzod said: Простите, пост продублировался. я Вам тестовый проект отправил, посмотрите пожалуйста, там два случая как можно отобразить иконку. Сейчас проблема во втором случае поле DocVariant урезается иконка, а в поле CustomVariant не могу скрыть кнопки где нет иконки Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 14, 2021 Share Posted August 14, 2021 10 hours ago, =GGG= said: я Вам тестовый проект отправил, посмотрите пожалуйста, там два случая как можно отобразить иконку. Сейчас проблема во втором случае поле DocVariant урезается иконка, а в поле CustomVariant не могу скрыть кнопки где нет иконки 10 hours ago, Sherzod said: Создайте скрытый столбец... procedure TMainForm.UniFormShow(Sender: TObject); begin cdsData.close; cdsData.createDataSet; cdsData.Append; cdsDataCustomVariant.AsInteger := 1; cdsDataDocVariant.AsInteger := 1; cdsDatainvisibleCol.AsInteger := 1; //<--------- cdsData.Post; ... function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { var widgetColIndx=0; var inVisibleColIndx=2; columns[inVisibleColIndx].hideable=false; columns[widgetColIndx].onWidgetAttach = function(column, widget, record) { widget.setVisible(record.get(inVisibleColIndx) != 0); }; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.