Jump to content

Error in the UnidbGrid popup menu. [ SOLVED ]


Fábio Matte

Recommended Posts

Good afternoon, I have a problem putting my PopUp menu in UnidbGrid.

 

Until version 1398 was working, and now in version 1466 the menu opens in different place from where I click. See the image, where is the red arrow is where I click, and the popup opens higher. How to correct?

post-4883-0-69318000-1529435325_thumb.png

Link to comment
Share on other sites

In UniDbGrid in 'OnAjaxEvent' I put this code:
procedure TfrmPainelContAbastecimento.gridResultadoAjaxEvent(Sender: TComponent;
  EventName: string; Params: TUniStrings);
begin
  if EventName = 'popup' then
    subOpcoes.Popup(StrToInt(Params.Values['x']), StrToInt(Params.Values['y']));
end;

And in ExtEvents:

function mousedown(sender, x, y, eOpts)
{
    if (eOpts == 2) {
        Ext.defer(function(){
            ajaxRequest(sender, 'popup', ['x='+x, 'y='+y])
        }, 300);
    } 
}
Link to comment
Share on other sites

And even your code should work

 

Also try with "Sender":

...
UniPopupMenu1.Popup(StrToInt(Params.Values['x']), StrToInt(Params.Values['y']), Sender);

Or better to use (mousedown):

procedure TMainForm.UniDBGrid1CellContextClick(Column: TUniDBGridColumn; X,
  Y: Integer);
begin

end;
Link to comment
Share on other sites

 

And even your code should work

 

Also try with "Sender":

...
UniPopupMenu1.Popup(StrToInt(Params.Values['x']), StrToInt(Params.Values['y']), Sender);

Or better to use (mousedown):

procedure TMainForm.UniDBGrid1CellContextClick(Column: TUniDBGridColumn; X,
  Y: Integer);
begin

end;

 

 

I did the way you indicated, but it still remains in the wrong place. Attached image.

post-4883-0-96876000-1529438129_thumb.png

Abastecimento.rar

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...