Filter button on toolbar

I want to create a filter button on the toolbar to filter quotes by status (open / closed) … and when you click the button again … show all. I have figured out how to put the button on the toolbar … and using a ‘link’ (which creates a 2nd grid) I can make it do what I want to see. I’ve also figured out how to do it with a ‘search’ grid … to show the grid that I am looking at … but I don’t want to have the search dialog display … I just want to click the button.

I don’t want a 2nd grid … I just want to filter the grid that I’m looking at.

I understand that I can do it with the default ‘advanced search’ button … but this is a common thing and I’d like to have a button specifically for this purpose.

New to scriptcase; using v8

that should be fairly easy:

change the sql of your grid to something like this


select *
from   mytable
where  status in ( [g_ListOfStatus] )

then in your onApplicationInit event code something like


if ( [g_ListOfStatus] == "" )
{
   [g_ListOfStatus] = <List of all the status, for example "1,2,3,4,5">
}

then in your filter[show only 1 status] button code this:


//set the gobal to the status you want to be considered
[g_ListOfStatus] = <The status you are filtering for example "1,3">

// then redir to the same report so it takes the new filter
sc_redir( '<name of my grid application>' , g_ListOfStatus = [g_ListOfStatus]);


And… thats it =D hope this helps

Regards

This does not work. This is the error that I get:
Parse error: syntax error, unexpected ‘}’ in C:\Program Files (x86)\NetMake\v8\wwwroot\scriptcase\app\pds\grid_quote\grid_quote.php on line 523

That means you have an error in your php code… either share your code or review it yourself.

Regards

I think I have probably changed things since then … so the code would not be what it was a few days ago. Will try again. Disregard this post for now.