Changes
10.05.2010: Sorry guys, there was an debug alert in the script. I removed it in version 0.2.
10.06.2010: You're now able to put different values into a textbox, just put a ";" between them. So a textbox using the delimiters is handled the same as multiple textboxes with separate values. The column and operator settings will be applied to all elements.
What do I need?
Well, JQuery and the Telerik MVC Grid
Where do I start?
1. Give the grid a name, i.e. filteredGrid.
2. Put this one into document ready: $('#filteredGrid').gridFilter();
The "Apply Button"
By default, the apply button has to have the following class: "applyFilterButton"
What do I do in my html?
<input type="checkbox" class="gridfilter gf-op-range gf-col-Chambers" value="4::5" /> <input type="checkbox" class="gridfilter gf-op-range gf-col-Chambers" value="5::6" /> <input type="checkbox" class="gridfilter gf-op-eq gf-col-Chambers" value="5" /> <input type="checkbox" class="gridfilter gf-op-ne gf-col-Chambers" value="5" /> <input type="checkbox" class="gridfilter gf-op-gt gf-col-Chambers" value="5" /> <input type="radio" name="radiogroup" class="gridfilter gf-op-eq gf-col-Type" value="0" /> <input type="radio" name="radiogroup" class="gridfilter gf-op-eq gf-col-Type" value="1" /> <input type="radio" name="radiogroup" class="gridfilter gf-op-eq gf-col-Type" value="2" /> <input type="text" class="gridfilter gf-op-substringof gf-col-City" value="er" /> <input type="text" class="gridfilter gf-op-endswith gf-col-City" value="rn" /> <input type="text" class="gridfilter gf-op-startswith gf-col-City" value="be" />
Ok those are some pretty nice examples. Basically you give the input 3 classes:
the gridfilter class, the gf-op-
http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-grid-client-api.html
Name of the column you wish to filter
This one goes out to all the Vulcans
To the logic, operations on the same column get connected with an OR expression, different
columns get connected by an AND expression:
(column1 OR column1) AND (column2) AND (column3 OR column3)
I think thats pretty much it.. here you go with a nice CNF (conjunctive normal form) :-)
Download
Get the newest version here (Version 0.3) (Changes)
Have fun!
Hi!
AntwortenLöschenCan you provide some demo.
It`s not clear how I can integrate applyButton with custom ajax binding for example.
Thanks!
Hello,
AntwortenLöschencould you provide some demo.
Hi
AntwortenLöschenThank for this great plugin
It is really helpfull
Why not proding it to the Telerik Code Library
here
http://www.telerik.com/community/code-library/aspnet-mvc.aspx
Got it working nicely - thank you for your effort.
AntwortenLöschenHow could I search across multiple columns with one query? For example, search in substring for values in either the Name column or the Category column?
I agree with a lot of what you're saying here but it could do with more detail. They stayed away in droves.
AntwortenLöschenIt has taken me ages to discover your site. Finally. This is just the information I was looking for.
AntwortenLöschenThere appears to be an issue with filter values including apostraphes (').
AntwortenLöschenIf you update the code in the inputToFilter() function to be:
// If type is Text
if (type.toLowerCase() == 'text') {
value = object.val().replace(/'/g, "''");
}
that should resolve the issue.
Hallo, ich teste gerade mit dem Telerik Grid. Ist es möglich eine kurze Demo zu schreiben wie die Funktion ins View eingebunden wird, und wie man dann mit dem "ApplyButton filtern kann. Besten Dank im Voraus.
AntwortenLöschenThanks for the information
AntwortenLöschenparfum
Aksesoris Mobil
Teralis
Kanopi
Thanks for the info. In case when you traveling, you might need a GPS for your car or boat and even knowing your own location.
AntwortenLöschenA very insightful information and it very helpful. In case need some info about tangki fiberglass. Thanks for sharing.
AntwortenLöschen