CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Set Filter on JQGrid Column on create

by feland » 06 May 2019 10:32

Hi,
I will set a JQgrid filter on toolbar search as default on jqgrid load.

How I can do it? On attachment an example of How I want it.

The request is urgent.
Thanks
You do not have the required permissions to view the files attached to this post.
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12

by feland » 07 May 2019 11:00

Hi,
I solved the question using the following instruction:
gridFatturePass.JQGridColumns.ItemsByName[sColName].SearchOptions.DefaultValue := '2137600019'


but when I clear the filter clicking on button (x) (see the attachment) the filter is not deleted.

Why?

Thanks,
Feland
You do not have the required permissions to view the files attached to this post.
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12

by feland » 07 May 2019 16:04

It's very urgently please can you help me?
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12

by feland » 08 May 2019 08:13

Any news?

Thanks,
Feland
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12

by feland » 13 May 2019 08:15

Hi, any news?

the request is urgently.

Thanks feland
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12

by Alexander Bulei » 13 May 2019 09:37

Hi feland,

That property (default value), works in this way, on clear click the grid will revert the search input value with default value (if setted).
So, I think, you need something like this:

delphi code
procedure TIWForm2.IWCGJQGrid1JQGridOptionsLoadComplete(Sender: TObject; AParams: TStringList);
var
Def, Js: string;
begin
Def:= '444';
Js:= Format('$("#gs_%s").val("%s")', [IWCGJQGrid1.JQGridOptions.ColModel[0].Name, Def]);
CGAddJavaScriptToAjaxResponse(Js);
end;


Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by feland » 03 Jun 2019 10:08

Hi, but how can find the column where I clear the filter?

The event JQGridToolBarSearch.OnBeforeClear can't tell me what is the column name.

Thanks Feland.
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12

by Alexander Bulei » 03 Jun 2019 10:50

Hi feland,
I don't understand what you want to do..due you've asking about the setting filter on create...
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by feland » 03 Jun 2019 15:18

Hi,

if i set multiple filters on grid and I wanted to delete only one with the method recommended, How Can i do it?
In the command
Js:= Format('$("#gs_%s").val("%s")', [IWCGJQGrid1.JQGridOptions.ColModel[0].Name, Def]);
I need to specify the column position
Colmodel[0]
. How can I retrieve this information?

the Event JQGridToolBarSearch.OnBeforeClear don't give me that info.

Thanks.
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12

by Alexander Bulei » 03 Jun 2019 16:05

Hi feland,

I'm still not cleared about your issue.
Please describe better, when/which event? what? where?

The information that you provide is not enough.

How can I retrieve this information?


Use available methods on ColModel...

the Event JQGridToolBarSearch.OnBeforeClear don't give me that info.


Use the debugger and browser parameters if you need extra data:

viewtopic.php?f=5&t=3843

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

Next

Return to JQGrid

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.