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

[Solved] filter by text string

3 Answers 163 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.
Hetal
Top achievements
Rank 1
Hetal asked on 22 Sep 2012, 06:13 AM
hello..

generally we use filter as follows in code...

var enteredFilterStr = null;
gridPersons.filter("");
enteredFilterStr = "FNAME~substringof~'" + $("#FNAME").val() + "'";
gridPersons.filter(enteredFilterStr);

but my requrement is I want to compare just 1st 4 characters of both input field ($("#FNAME").val()) and grid column value (FNAME).
So, I can do on input field as follows...
enteredFilterStr = "FNAME~substringof~'" + $("#FNAME").val().substr(0,3) + "'";
But how can I apply the same logic on FNAME grid column value?

3 Answers, 1 is accepted

Sort by
0
Hetal
Top achievements
Rank 1
answered on 23 Sep 2012, 04:32 AM
can anyone help? its urgent.
0
Pedro
Top achievements
Rank 2
answered on 08 Oct 2012, 05:08 PM
have you tried playing with the query string filter? 

http://server/index.html?Grid-filter= {insert filter}

Pedro
0
Hetal
Top achievements
Rank 1
answered on 10 Oct 2012, 03:14 AM
No, I don't have any idea of this. Can you give details of the same. Just now I have following code...

gridPersons.filter("FNAME~substringof~'" + $("#FNAME").val() + "'and~MNAME~substringof~'" + $("#MNAME").val() + "'and~LNAME~substringof~'" + $("#LNAME").val() + "'");
$('#PersonSearchListWindow').data('tWindow').center().open();

where gridpersons variable having all records and applying filter on it gives filtered data.
and grid is then shown in PersonSearchListWindow  telerik window. So how can I apply your logic now?
Tags
Grid
Asked by
Hetal
Top achievements
Rank 1
Answers by
Hetal
Top achievements
Rank 1
Pedro
Top achievements
Rank 2
Share this question
or