Masteritec Posted July 12, 2019 Share Posted July 12, 2019 Hi, Is it possible to let us to popupmenu at column title. Current only allow us to popuomenu in cell content. Please advice. Thanks Link to comment Share on other sites More sharing options...
Sherzod Posted July 12, 2019 Share Posted July 12, 2019 3 hours ago, Masteritec said: Is it possible to let us to popupmenu at column title. Current only allow us to popuomenu in cell content. Please advice. Hi, You can try to use this approach. 1. UniMainModule.BrowserOptions.boDisableMouseRightClick = True 2. UniDBGrid1.ClientEvents.ExtEvents -> function headercontextmenu(ct, column, e, t, eOpts) { ajaxRequest(this, "_hcmenu", ["x="+(e.clientX-this.getEl().getX()), "y="+(e.clientY-this.getEl().getY()) ]); } 3. UniDBGrid1.OnAjaxEvent -> procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var X, Y: Integer; begin if EventName = '_hcmenu' then begin X := Params.Values['x'].ToInteger(); Y := Params.Values['y'].ToInteger(); UniPopupMenu1.Popup(X, Y, Sender); end; end; Link to comment Share on other sites More sharing options...
Masteritec Posted July 12, 2019 Author Share Posted July 12, 2019 2 hours ago, Sherzod said: Hi, You can try to use this approach. 1. UniMainModule.BrowserOptions.boDisableMouseRightClick = True 2. UniDBGrid1.ClientEvents.ExtEvents -> function headercontextmenu(ct, column, e, t, eOpts) { ajaxRequest(this, "_hcmenu", ["x="+(e.clientX-this.getEl().getX()), "y="+(e.clientY-this.getEl().getY()) ]); } 3. UniDBGrid1.OnAjaxEvent -> procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var X, Y: Integer; begin if EventName = '_hcmenu' then begin X := Params.Values['x'].ToInteger(); Y := Params.Values['y'].ToInteger(); UniPopupMenu1.Popup(X, Y, Sender); end; end; Great, It works Thanks Link to comment Share on other sites More sharing options...
Recommended Posts