Overview
Let us see how to implement the Custom Filters or Search functionality in "TodoList JQGrid MVC sample application".
Search functionality in JQGrid can be implemented in 2 ways:-
1. Client Side Search functionality (Built in JQGrid Feature).
Video: https://www.youtube.com/watch?v=5w2ycpN2jss
Video: https://www.youtube.com/watch?v=5w2ycpN2jss
2. Server Side Search functionality (Custom Filters)
1. Client Side Search functionality (Built in JQGrid Feature).
There are 2 steps to implement the JQGrid Built in Search functionality from the client side.
Step 1: Add "loadonce" property to JQGrid and set it to true.
Step 2: Set "search" property to true in navGrid method.
Note: Disadvantage of using this approach is pagination functionality will be disabled, since "loadonce" property is set to true. So we have to load all the record at once. And the search functionality will be performed by the JQGrid on the Client side itself.
- Set "loadonce" property to false present in the "TodoList.js" file.
- Open TodoList "Index.cshtml" page and add the required filters.
- 3 fields namely Task Name, Severity and Target date is added has a filter.
- 1 Search button is added for filtering the data.
- A class with name "filterItem" is been added in all the 3 fields.
- Open "TodoList.js" page.
- Add a jquery click functionality in Document.Ready Function() to post the filter values to the controller and reload the JQGrid.
- Open "TodoListController" and add additional required filter parameters.
- Also handle the Searchfunctionality with help of Linq Queries based on the condition i.e. value present in the parameters that are received.
Is there any article jqgrid with grouping and paging
ReplyDeleteThanks! For the best example using MVC+jqGrid.
ReplyDeleteYou have a tallant to explain easy about complicated. Good lack with new articles.
ReplyDeleteFilter Button is not working..., Please upload new version its very useful to me
ReplyDeletehttps://jqgridsearchfilter.codeplex.com/
DeleteDownload the sample project..
thank you..
Is there any demo related to custom export to excel from jqgrid?
ReplyDeletehi sir small doubt it is work only strongly type html controls or how to html input tag id value pass to server for same serching
ReplyDeleteHi Dileep, it's really useful one, can you give an example how can we show or hide column on UI, i need to get a popup when a click any custom icon, which contains the all the column headers are like checkboxes and i can choose required column and hide remaining
ReplyDeleteIt will allow you to truly unleash your potential as a web developer but you need to have a higher level of expertise when it comes to understanding CSS and HTML.
ReplyDeleteMVC developer in India
Your article is too good and thanks for sharing your article with us. It is very different and unique. I liked how you explained that top developers are confused about the remote work. I am glad you cleared the doubts. One of the best freelancing platforms is, Eiliana.com; they help developers get good work according to their profile.
ReplyDelete