Skip to content

Move the Search Outside of the Grid

Question:
The current integrated search work in phpGrid is that you can type search text and the data will be filtered as you type, without reloading the page. The question is how to setup a search function just like that, but outside the grid. 

Answer:
Use javascript for this (external search) to happen. Pass search criteria through the "postData" property, then trigger the grid reload.  You can also pre-fill the search criteria in the search bar this way. 

Here's a code example:

$(function() {
jQuery("#TABLE_NAME″).setGridParam({
        postData:{"search":true,"col1":"search_value1,"col2":"search_value2" ….},
        page:1
    }).trigger("reloadGrid");
});


Feedback and Knowledge Base