This is a migrated thread and some comments may be shown as answers.

Wildcard filtering, "AND"/"OR" etc

1 Answer 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Matthew
Top achievements
Rank 2
Matthew asked on 14 May 2010, 06:09 PM
Hello,

I am currently tasked with adding wildcard and boolean filtering ability that works with the MVC Grid. I understand that the grid supports these functionalities, but is there support for wildcards at all? 

My current filtering works such that for each field there is a input to filter by "Contains" from a textbox, above each field. I then build an ajax request that looks something like..

(my javascript line is below)

   var pn = $("#FilterPartNumber").val(); 
    var desc = $("#FilterDescription").val(); 
    var project = $("#Projects").val(); 
 
    var grid = $("#ItemsGrid").data("tGrid"); 
 
   desc = stripQuotes(desc); 
    pn = stripQuotes(pn); 
    project = stripQuotes(project); 
     
    grid.filterBy = "substringof(PartNumber,\'" + pn + "\')~and~substringof(Description,\'" + desc + "\')~and~substringof(PartNumber,\'" + project + "\')"; 
    grid.pageTo(1); 

Is there anything currently existing in the controls that lets me pass wildcards ie "abc*123" or etc and parses them automatically, does anyone have recommnedations for existing products that will do this, or do I need to write a parser myself? Thanks :)

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 15 May 2010, 08:07 AM
Hello Matthew,

The MVC grid does not support wildcard filtering. What it supports is "startswith", "contains", "equals" and "endswith" for string values. To support wildcards you would need to implement a parser yourself e.g. for abc*ed you should generate startswith(abc) and endswith(ed).

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Matthew
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Share this question
or