Karsten Posted February 26, 2023 Share Posted February 26, 2023 Hello, is it possible, to catch a Doubleclick on "Group-Captions" (Red marked) to get the Caption as string? Greetings, Karsten Quote Link to comment Share on other sites More sharing options...
asapltda Posted February 26, 2023 Share Posted February 26, 2023 +1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 27, 2023 Share Posted February 27, 2023 Hello, 10 hours ago, Karsten said: is it possible, to catch a Doubleclick on "Group-Captions" (Red marked) to get the Caption as string? GroupFieldName or GroupFieldCaption+GroupFieldName ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 27, 2023 Share Posted February 27, 2023 @Karsten @asapltda Try this approach. 1. OnCreate -> procedure TMainForm.UniFormCreate(Sender: TObject); begin // Considering that the index of the grouping field will not change at run time... UniDBGrid1.JSInterface.JSAddListener( 'afterrender', 'function(sender){'+ ' sender.getEl().on("dblclick", function(e, target, options) {'+ ' ajaxRequest(sender, "groupTitleDblClick", {groupTitle: e.record.data['+ UniDBGrid1.DataSource.DataSet.FieldByName(UniDBGrid1.Grouping.FieldName).Index.ToString() +']})'+ ' }, sender.getEl(), {'+ ' preventDefault: true,'+ ' delegate: ".x-grid-group-title"'+ ' })'+ '}' ) end; 2. OnAjaxEvent -> procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'groupTitleDblClick' then ShowMessage(Params.Values['groupTitle']) end; Quote Link to comment Share on other sites More sharing options...
Karsten Posted February 27, 2023 Author Share Posted February 27, 2023 Hello, I use "...ajaxRequest(sender, "groupTitleDblClick", {groupTitle: e.record.data[0]})'+...", because dataset is not active on UniFormCreate. Works perfect. Many thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 27, 2023 Share Posted February 27, 2023 Okay. Thx. 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.