Hi
I have two elements in one cell using the return function for this particular field:
function(dataItem) {
return kendo.htmlEncode(dataItem.Title) + "<br>" + kendo.htmlEncode(dataItem.City);
}
The filter does not work anymore, for example searching for "lon" (as in London) does not return any results.
http://dojo.telerik.com/ukOja/9
Mant thanks
I have two elements in one cell using the return function for this particular field:
function(dataItem) {
return kendo.htmlEncode(dataItem.Title) + "<br>" + kendo.htmlEncode(dataItem.City);
}
The filter does not work anymore, for example searching for "lon" (as in London) does not return any results.
http://dojo.telerik.com/ukOja/9
Mant thanks
5 Answers, 1 is accepted
0
Hello Markus,
As you may know the filtering is done over the DataSource data (not over the UI) using the field to which the column is bound. Therefore, in the provided sample, searching for London in the Title column will not work as there is no such title value. If you want to filter on the combined values of title and city fields then you will need to create a field in the data which to hold their combined value and bind the column to this field.
Regards,
Rosen
Telerik
As you may know the filtering is done over the DataSource data (not over the UI) using the field to which the column is bound. Therefore, in the provided sample, searching for London in the Title column will not work as there is no such title value. If you want to filter on the combined values of title and city fields then you will need to create a field in the data which to hold their combined value and bind the column to this field.
Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Markus
Top achievements
Rank 1
answered on 28 Jan 2015, 04:30 PM
Thank you for your reply.
Just to confirm: So what I want is to have value1<br>value2 in my cell and still being able to filter (search) for whatever string is in that column. -> That cannot be done, is that right?
Thanks
Just to confirm: So what I want is to have value1<br>value2 in my cell and still being able to filter (search) for whatever string is in that column. -> That cannot be done, is that right?
Thanks
0
Hello Markus,
Yes, it it not supported. As I have stated in my previous reply you should have a field in the data which to have the value equal to the join value of both fields and then filter on this field.
Regards,
Rosen
Telerik
Yes, it it not supported. As I have stated in my previous reply you should have a field in the data which to have the value equal to the join value of both fields and then filter on this field.
Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Markus
Top achievements
Rank 1
answered on 04 Feb 2015, 08:07 AM
Hi
Ok I have now created a field which has both the values. I can also easily send this in my "life" environment where my DB sends JSON data.
How can I send the "string" so that the second value is on a new line? The "<br>" tag does not seem to work, please see my example:
http://dojo.telerik.com/ukOja/11
Thanks
Ok I have now created a field which has both the values. I can also easily send this in my "life" environment where my DB sends JSON data.
How can I send the "string" so that the second value is on a new line? The "<br>" tag does not seem to work, please see my example:
http://dojo.telerik.com/ukOja/11
Thanks
0
Hello Markus,
The <br/> does not work as the column value is encoded by default. You can disabled this by setting the encoded option of the column to false.
Regards,
Rosen
Telerik
The <br/> does not work as the column value is encoded by default. You can disabled this by setting the encoded option of the column to false.
{ field: "TitlenCity", width: 200, encoded: false}Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!