Jump to content

Recommended Posts

Posted

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?

Posted

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;
Posted

 

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;
 
image.jpg
 
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 :(
Posted

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.

  • Like 1
Posted

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
  • Like 1
  • 2 months later...
Posted

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

 

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.

Posted

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.
 
 
Thanks a lot for the help
  • 2 years later...
Posted
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? 

Posted
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!

  • 3 weeks later...
Posted

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.

 

 

Screenshot_20.jpg

Posted
12 minutes ago, gerhardhziegler said:

The case is very simple, I extracted now from my application and source:

Make a simple testcase if possible.

×
×
  • Create New...