Jump to content

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


eduardosuruagy

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
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...