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 Link to comment Share on other sites More sharing options...
asapltda Posted February 26, 2023 Share Posted February 26, 2023 +1 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 ? 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; 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. Link to comment Share on other sites More sharing options...
Sherzod Posted February 27, 2023 Share Posted February 27, 2023 Okay. Thx. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now