CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Link detection

by etwoss » 15 Apr 2014 08:27

Hi

As you can see there are two links in the grd (Product and Vendor)
How can i detect in the click event which one is clicked and whats the value?

Eric
You do not have the required permissions to view the files attached to this post.
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Jorge Sousa » 15 Apr 2014 09:43

Hi

I don't understand what you mean

if both columns have Formatter = gcfLinkClick you should have 2 events: Col[i].FormatOptionsLinkClick.OnClick
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by etwoss » 15 Apr 2014 09:59

Hi

haha, right of course!!!

How to find out the values selected?

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Jorge Sousa » 15 Apr 2014 10:18

Hi

Now i do understand your question.

1- if You set Col.FormatOptionsLinkClick.SelectRow=True, you can use Grid.JQGridOptions.SelRow

2- Has you can see in the inspector, OnClick has the arguments = 'rowid,cellvalue'

You can add a OnClick.BrowserParam and use rowid or cellvalue as BrowserScript, or simply setting OnClick.SendAllArguments=True, then you can acess trough the AParams in the event handler.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Jorge Sousa » 15 Apr 2014 10:18

Hi

Now i do understand your question.

1- if You set Col.FormatOptionsLinkClick.SelectRow=True, you can use Grid.JQGridOptions.SelRow

2- Has you can see in the inspector, OnClick has the arguments = 'rowid,cellvalue'

You can add a OnClick.BrowserParam and use rowid or cellvalue as BrowserScript, or simply setting OnClick.SendAllArguments=True, then you can acess trough the AParams in the event handler.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by etwoss » 15 Apr 2014 12:02

Hi

because this is generic code for a gridform where i do not know which columns will be selectable we have this code

Code: Select all
  for i := 0 to grid.JQGridOptions.ColModel.Count -1 do
  begin
    if (grid.JQGridOptions.ColModel[i].Formatter = gcfLinkClick) then
    begin
      grid.JQGridOptions.ColModel[i].FormatOptionsLinkClick.OnCLick.SendAllArguments := True;
      grid.JQGridOptions.ColModel[i].FormatOptionsLinkClick.SelectRow := True;
      grid.JQGridOptions.ColModel[i].FormatOptionsLinkClick.OnClick.OnEvent :=                              gridJQGridOptionsColModel0FormatOptionsClick;
    end;
  end;


The Aparms in the procedure TFormAdminReportOverview.gridJQGridOptionsColModel0FormatOptionsClick(
contains this values (an example):

Code: Select all
GRID_SELROW=7
IW_TrackID_=9
IW_SessionID_=0vfy7on1x14v61169d1o30vriu8r
callback=GRID.DoAjaxRequest
ajaxevent=JQGridOptions.ColModel.Items[0].FormatOptions.OnClick
rowid=7
cellvalue=Limited Function / Open
ComponentName=grid


So i now the cellValue but i also need to know the column name to see what the value is (A vendor , A Product?)

How to get this information?

I already See:

ajaxevent=JQGridOptions.ColModel.Items[0].FormatOptions.OnClick

It contains the colModel.Items[x]!!!


Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Jorge Sousa » 15 Apr 2014 14:07

Hi

The Sender: TObject parameter in the event handler, is always the owner of the event

So, for

FormatOptionsLinkClick.OnClick

the Sender will be

procedure TIWForm1.LinkClick(Sender: TObject; AParams: TStringList);
var
FormatOptions: TIWCGJQGridFormatOptionsLinkClick;
begin
FormatOptions:= Sender as TIWCGJQGridFormatOptionsLinkClick;
FormatOptions.Col.Name; // This is the column
end;
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by etwoss » 16 Apr 2014 07:39

Hi

TIWCGJQGridFormatOptionsLinkClick???

Can't find this class in sourcecode?

Which unit is this in?

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Jorge Sousa » 16 Apr 2014 10:10

Hi

Actually is

TIWCGJQGridColFormatOptionsLinkClick

in IWCGGrid.pas
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58


Return to JQGrid

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.