Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:custom_searching [2009/07/26 17:50]
tony
wiki:custom_searching [2017/12/12 17:16] (current)
admin
Line 1: Line 1:
 ====== Custom Searching ====== ====== Custom Searching ======
 This method can be called to construct an custom search form for the grid.\\ ​ This method can be called to construct an custom search form for the grid.\\ ​
-The method uses the url option in grid to perform a search to the server. \\ +The method uses the url option in grid to perform a search to the server. \\
 When the search is activated, an array of type name:value is posted to the server. Note that this array is added to the postData parameter. We post only fields that have an entered value. When we clear the the search form, the values are deleted from the postData array. When posting to the server, we try to pass, not the name, but the index set in colModel. When the index is not found we use the name. Additionally,​ we add a _search=true to the posted data.  When the search is activated, an array of type name:value is posted to the server. Note that this array is added to the postData parameter. We post only fields that have an entered value. When we clear the the search form, the values are deleted from the postData array. When posting to the server, we try to pass, not the name, but the index set in colModel. When the index is not found we use the name. Additionally,​ we add a _search=true to the posted data. 
  
Line 16: Line 16:
 and then and then
 <code javascript>​ <code javascript>​
-jQuery("#​mysearch"​).filterGrid("#​grid_id",​options);​+jQuery("#​mysearch"​).filterGrid('#grid_id',​options);​ 
 +</​code>​ 
 +or using the new API 
 +<code javascript>​ 
 +jQuery("#​mysearch"​).jqGrid('​filterGrid','#​grid_id'​,options);
 </​code>​ </​code>​
  
Line 59: Line 63:
 sg.clearSearch();​ sg.clearSearch();​
 </​code>​ </​code>​
 +
 +<note important>​Do not use these methods with the new API. They will not work!</​note>​

QR Code
QR Code wiki:custom_searching (generated for current page)