fraxzi Posted September 7, 2021 Share Posted September 7, 2021 Hi Everyone, When I double-click the rows in dbtreegrid, I need to know if the selected row is the TreeKeyField or the Clild node. How to know? Thanks, Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 7, 2021 Share Posted September 7, 2021 1 hour ago, fraxzi said: When I double-click the rows in dbtreegrid, I need to know if the selected row is the TreeKeyField or the Clild node. Hello, This post may help you: Quote Link to comment Share on other sites More sharing options...
fraxzi Posted December 22, 2022 Author Share Posted December 22, 2022 On 9/7/2021 at 6:45 PM, Sherzod said: Hello, This post may help you: Hi @Sherzod, Going back .. Unfortunately i don't know how to implement this. Can you help? Thanks, Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 22, 2022 Share Posted December 22, 2022 7 minutes ago, fraxzi said: Unfortunately i don't know how to implement this. Can you help? Hello, Please clarify what do you want to achieve? And what is the issue at the moment? Quote Link to comment Share on other sites More sharing options...
fraxzi Posted December 22, 2022 Author Share Posted December 22, 2022 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 22, 2022 Share Posted December 22, 2022 Try replace sender to this: ajaxRequest(this, Quote Link to comment Share on other sites More sharing options...
fraxzi Posted December 22, 2022 Author Share Posted December 22, 2022 1 minute ago, Sherzod said: Try replace sender to this: ajaxRequest(this, @Sherzod Eureka! It works!! 🤩 from now on I will use "ajaxRequest(this," ... Thanks much! Quote Link to comment Share on other sites More sharing options...
fraxzi Posted December 22, 2022 Author Share Posted December 22, 2022 Oh, one more thing.. How can I pass the cell value to ajaxRequest and get it? Thanks, Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 22, 2022 Share Posted December 22, 2022 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; 1 Quote Link to comment Share on other sites More sharing options...
fraxzi Posted December 22, 2022 Author Share Posted December 22, 2022 Thanks for the Christmas gift 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.