Jump to content
uniGUI Discussion Forums
eduardosuruagy

I would like to click on a dbgrid column and open a poupup, how?

Recommended Posts

Tip of

 

http://forums.unigui.com/index.php?/topic/1149-cell-grid-position/

 

 

Try This

 

In UniDBGrid > ExtEvents > Ext.grid.Panel

 

function cellmousedown(sender, td, cellIndex, record, tr, rowIndex, e, eOpts)
{
    var c = Ext.get(td).getXY();
    ajaxRequest(this, 'CellXY', ['x='+c[0], 'y='+c[1]]);   
}

 

 

In VCL...

 

  private

    { Private declarations }
    ColIndex, RowIndex: Integer;
  public
    { Public declarations }
  end;
 
implementation
 
{$R *.dfm}
 
uses MainModule;
 
procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent;
  EventName: string; Params: TUniStrings);
begin
  if EventName = 'CellXY' then
  begin
    ColIndex := Params['x'].AsInteger;
    RowIndex := Params['y'].AsInteger
  end;
end;
 
procedure TMainForm.UniDBGrid1CellClick(Column: TUniDBGridColumn);
begin
  UniPopupMenu1.Popup(ColIndex + Column.Width, RowIndex);
end;
 
 
Best regards,
 
Eduardo Belo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×