MSMK Posted April 24, 2021 Share Posted April 24, 2021 Можно ли как то определить как запись выделена? Нужно чтоб при выделении последней в ветки записи кнопка редактировать и удалить были активными. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 24, 2021 Share Posted April 24, 2021 4 hours ago, =GGG= said: Можно ли как то определить как запись выделена? Нужно чтоб при выделении последней в ветки записи кнопка редактировать и удалить были активными. Здравствуйте, Один из возможных решений, использовать клиентское событие как дано здесь: Quote Link to comment Share on other sites More sharing options...
MSMK Posted April 25, 2021 Author Share Posted April 25, 2021 12 hours ago, Sherzod said: Здравствуйте, Один из возможных решений, использовать клиентское событие как дано здесь: добрый день! а как обратиться к кнопкам на стороне клиента? Grid - DBTreeGrid.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 25, 2021 Share Posted April 25, 2021 4 hours ago, =GGG= said: добрый день! а как обратиться к кнопкам на стороне клиента? Grid - DBTreeGrid.zip 652.8 kB · 1 download Добрый день, Попробуйте: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniDBTreeGrid1.ClientEvents.ExtEvents.Values['beforeselect'] := 'function beforeselect(sender, record, index, eOpts){'+ btnEdit.JSName + '.setDisabled(record.childNodes.length > 0);'+ btnDelete.JSName + '.setDisabled(record.childNodes.length > 0);'+ '}'; ... Quote Link to comment Share on other sites More sharing options...
MSMK Posted April 25, 2021 Author Share Posted April 25, 2021 10 minutes ago, Sherzod said: Добрый день, Попробуйте: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniDBTreeGrid1.ClientEvents.ExtEvents.Values['beforeselect'] := 'function beforeselect(sender, record, index, eOpts){'+ btnEdit.JSName + '.setDisabled(record.childNodes.length > 0);'+ btnDelete.JSName + '.setDisabled(record.childNodes.length > 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.