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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...