leandroavila74 Posted December 21, 2016 Posted December 21, 2016 As I get something similar to what happens in onfieldimageurl that passes as AField parameter ? thx
Sherzod Posted December 21, 2016 Posted December 21, 2016 Hi, Sorry, can you clarify your question ? Best regards.
leandroavila74 Posted December 22, 2016 Author Posted December 22, 2016 Hi, Sorry, can you clarify your question ? Best regards. Hi, Unidbgrid contains the "OnCellClick" event but unimdbgrid does not contain this event, how do I get which "Field" was clicked on unimdbgrid?
Sherzod Posted December 22, 2016 Posted December 22, 2016 Can you try this ?: 1. UnimDBGrid1 -> ClientEvents -> ExtEvents -> function itemtap: function itemtap(sender, index, target, record, e, eOpts) { ajaxRequest(sender, '_cellclick', ["cellindx="+index, "colindx="+e.target.$column.getDataIndex()]); } 2. UnimDBGrid1AjaxEvent: procedure TMainmForm.UnimDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_cellclick' then begin ShowMessage(Params.Values['cellindx']+', '+Params.Values['colindx']); end; end;
leandroavila74 Posted December 22, 2016 Author Posted December 22, 2016 Can you try this ?: 1. UnimDBGrid1 -> ClientEvents -> ExtEvents -> function itemtap: function itemtap(sender, index, target, record, e, eOpts) { ajaxRequest(sender, '_cellclick', ["cellindx="+index, "colindx="+e.target.$column.getDataIndex()]); } 2. UnimDBGrid1AjaxEvent: procedure TMainmForm.UnimDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_cellclick' then begin ShowMessage(Params.Values['cellindx']+', '+Params.Values['colindx']); end; end; I would like to be able to intercept the tap of the images, I have the 2 fields that are of type images, I want to be able to know when I click on "minus" or "plus". The previous example was perfect, but it does not take the clicks on the images
Sherzod Posted December 22, 2016 Posted December 22, 2016 Ok, Then try this: function itemtap(sender, index, target, record, e, eOpts) { var _column=e.target.parentNode.$column || e.target.$column; ajaxRequest(sender, '_cellclick', ["cellindx="+index, "colindx="+_column.getDataIndex()]); } Best regards. 1
leandroavila74 Posted December 22, 2016 Author Posted December 22, 2016 Ok, Then try this: function itemtap(sender, index, target, record, e, eOpts) { var _column=e.target.parentNode.$column || e.target.$column; ajaxRequest(sender, '_cellclick', ["cellindx="+index, "colindx="+_column.getDataIndex()]); } Best regards. you are the best! worked perfectly thank you so much 1
leandroavila74 Posted March 2, 2017 Author Posted March 2, 2017 Ok, Then try this: function itemtap(sender, index, target, record, e, eOpts) { var _column=e.target.parentNode.$column || e.target.$column; ajaxRequest(sender, '_cellclick', ["cellindx="+index, "colindx="+_column.getDataIndex()]); } Best regards. Delphi Developer, Why this example does not work with "TUnimDBListGrid"? I tried to use it the same way and it does not work Best regards.
Sherzod Posted March 2, 2017 Posted March 2, 2017 Hi, Ok, I will try to find a solution Best regards.
Sherzod Posted March 2, 2017 Posted March 2, 2017 Delphi Developer, Why this example does not work with "TUnimDBListGrid"? I tried to use it the same way and it does not work Best regards. Hi, Can you try this approach for now?!: function itemtap(sender, index, target, record, e, eOpts) { var _cmp=Ext.get(e.target); var colIndx=$(Ext.get(target.id).select('#'+_cmp.id+'.x-mgrid-cell').elements[0]).index(); if (colIndx!=-1) { ajaxRequest(sender, '_cellclick', ["rowIndx="+index, "colIndx="+colIndx]); }; } procedure TMainmForm.UnimDBListGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_cellclick' then begin ShowMessage(Params.Values['rowIndx']+', '+Params.Values['colIndx']); end; end; Best regards.
leandroavila74 Posted March 3, 2017 Author Posted March 3, 2017 Hi, Can you try this approach for now?!: function itemtap(sender, index, target, record, e, eOpts) { var _cmp=Ext.get(e.target); var colIndx=$(Ext.get(target.id).select('#'+_cmp.id+'.x-mgrid-cell').elements[0]).index(); if (colIndx!=-1) { ajaxRequest(sender, '_cellclick', ["rowIndx="+index, "colIndx="+colIndx]); }; } procedure TMainmForm.UnimDBListGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_cellclick' then begin ShowMessage(Params.Values['rowIndx']+', '+Params.Values['colIndx']); end; end; Best regards. Hello, It did not work for me, nothing happens at the event, But I'm solving my problem another way, using a unimscrollbox and creating my grid as I need it. Now I need your help on another topic. http://forums.unigui.com/index.php?/topic/8076-remove-all-controls-created-inside-an-unimscrollbox/ Thanks a lot for the help
gerhardhziegler Posted November 12, 2019 Posted November 12, 2019 ItemTab seems to be obsolete. I have childsingletap, childtap etc., but without Index param, but I cant figure out, how to extract the (clicked) column.
Sherzod Posted November 12, 2019 Posted November 12, 2019 2 hours ago, gerhardhziegler said: ItemTab seems to be obsolete. I have childsingletap, childtap etc., but without Index param, but I cant figure out, how to extract the (clicked) column. Hi, Can you make a simple testcase for this?
gerhardhziegler Posted November 12, 2019 Posted November 12, 2019 4 minutes ago, Sherzod said: Hi, Can you make a simple testcase for this? Yes, within the next days I will. Now I found a more than strange workaround which I hope to replace then! Thanks a lot, Sherzod!
gerhardhziegler Posted November 29, 2019 Posted November 29, 2019 The case is very simple, I extracted now from my application and source: I have a UnimDB Grid, which have two picture fields, that should act like "actionbuttons" (in desktop version). The challenge is: The green/gray buttons should fire wenn doublclicked (with column number) the "disclose" (fake) buttons should fire on single click. At the moment I am using the Events ChildTap and ChildDoubleTap and sending the clickobject back as parameter, because I couldnt find out, how to locate the column of the click. ajaxRequest(sender, '_cellclick', ["clickobject="+location.getFocusEl("el").id]); Afterwards, which is of course a bad idea, I am parsing the name of the object, because they are always numbered in the grid from 1-X, column after column, row after row. Using this I can get the clicked column by a Modulo of the column number. Of course this is "katastrofa" and causes an ajax error from time to time, saying grid is null or something like this. A good solution would be fine. At least to know, how to read the clicked col in the ChildTap oder ChildDoubleTap Event. Best thanks to all.
Sherzod Posted November 29, 2019 Posted November 29, 2019 12 minutes ago, gerhardhziegler said: The case is very simple, I extracted now from my application and source: Make a simple testcase if possible.
gerhardhziegler Posted November 29, 2019 Posted November 29, 2019 Here is the "unlucky" source and a error message, that also appears from time to time. ___TEST___.rar
Sherzod Posted November 29, 2019 Posted November 29, 2019 1 hour ago, gerhardhziegler said: ___TEST___.rar ajaxRequest(sender, '_cellclick', ["colIndx="+location.columnIndex]);
gerhardhziegler Posted November 29, 2019 Posted November 29, 2019 That works really very fine! I studied the Sencha Docu, but just "overread" these property. What a shame! Anyway, you are the best! Thanks 1
Recommended Posts