Custom search...

Jun 16, 2011 at 7:01 PM


First of all.... Thanks for the great work so far!

What I need in my site is create a search without the dialog window...How can I insert the search module direct on top of Grid ?





Jun 16, 2011 at 7:50 PM

While this isn't a complete fix, for example if you click the search button the grid will be greyed out, but it might get you started.

I followed some of this post :

Possible to make jqGrid Search Box Stay on Page?

Assuming your grid is named 'grid' you can use this function:


  function moveSearch() {
         prmSearch = { multipleSearch: true, overlay: false };

         var grid = $("#grid")
         // create the searching dialog
         // find the div which contain the searching dialog
         var searchDialog = $("#fbox_" + grid[0].id);

         // make the searching dialog non-popup
         searchDialog.css({ position: "relative", "z-index": "auto" })

and use the method .SetOnGridCompleteEvent("moveSearch")


It will change the CSS on the dialog box and move it up for you. However, like I said there are some bugs to work out.

Jun 17, 2011 at 7:30 PM

Thanks Philman!

Just a question about your design...

I have a repository method that do all the search, ordering and paging ... Doing that I have a better performance ...

All I need from the ToGridData method is create a JSON with my data... Is that possible?



Jun 18, 2011 at 11:51 PM


If you dont want to use the built-in paging mechanism, the ToGridData extension method has the following overload:

.ToGridData(int currentPage,int rowsPerPage);

That simply formats your model to a GridData object.