How to Pass Arguments to the GetHandler from a ListBox
Grid 3.2 and newer offers a special mechanism for adding and maintaining gethandler parameters. Since grid adds its own parameters to the gethandler, its necessary to keep track of custom parameters, and to test the custom parameters.
In this example, we will be using a listbox to display some values that we want to filter. For example, if we want to get everything in a certain category, we can then get only those items from the database of that category and only display those items in the grid.
Here is an example of the listbox:
We can then change our initialization so that it looks like this:
In this example, we're getting the value of the listbox, and loading it into the getData function by setting the onchange event in JavaScript.
Now, we need to define getData. getData will be our function that will actually maintain the attribute:
We pass in the query parameter query_param and add it to the query string as myparam. This is the name of the parameter that the get_handler will be getting. The important thing is that the parameter here has to match what is being passed to the back-end GetHandler script, otherwise this will not do anything.
dataBind then calls GET and retrieves data using the new properties. Later, you can use the setGetHandlerParameter again to edit the properties.
Comments:
Knowledgebase
To be notified of new articles when they're available, subscribe to our RSS feed.