Jump to content

How to determine if dbTreeGrid which row selected TreeKeyFields or Node (Column) field?


fraxzi

Recommended Posts

  • 1 year later...

Hi Sherzod,

Based on the above

if "Row.childNodes = 0" then
    ShowMessage('clicked');

I want to click on the child node and do something.

I do this:

function cellclick(sender, td, cellIndex, record, tr, rowIndex, e, eOpts)
{
    if (!record.hasChildNodes()) {
        ajaxRequest(sender, 'nodeclicked', {value: b}, false);
    }
}

and this:

procedure TLogs.dbGridPrjsAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
begin
  if EventName = 'nodeclicked' then
  begin
    ShowToast('node clicked!');
  end;
end;

but not working.. i know I did something not right.

 

 

Link to comment
Share on other sites

21 minutes ago, fraxzi said:

How can I pass the cell value to ajaxRequest and get it?

ajaxRequest(this, 'nodeclicked', {value: record.data[cellIndex]}, false);
procedure TMainForm.UniDBTreeGrid1AjaxEvent(Sender: TComponent;
  EventName: string; Params: TUniStrings);
begin
  //
  //..
  // Params.Values['value']
end;

 

  • Like 1
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...