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

Customize grid filter

4 Answers 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vladimir
Top achievements
Rank 1
Vladimir asked on 04 May 2012, 09:02 PM
A grid filter is defined in FilterMenu does not support customization as it always uses a hardcoded template.
More than that, the template contains an english text:
 
'<select name="logic" class="k-filter-and">'+
 '<option value="and">And</option>'+
 '<option value="or">Or</option>'+
 '</select>'+
 
This complicates localization.
 I suggest to:
 1. Localize text.
 2. Allow to provide a custom template.

4 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 08 May 2012, 12:19 PM
Hi Vladimir,

Thank you for the feedback.

Indeed it is possible to localize the text of the filter menu controls and we have a code library project that shows how this could be done.
The filter template functionality is not supported at present - it would be hard to build the filter widgets from a custom UI. It is possible though to modify the menu appearance with custom JavaScript code and CSS rules.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Martin
Top achievements
Rank 1
answered on 31 Jul 2014, 01:15 PM
localization would normally mean changing the text according to the user's locale.
This only seems to show how to change the labels to your own string. How do I change this dynamically to enable localization to more than 1 locale?
0
Martin
Top achievements
Rank 1
answered on 31 Jul 2014, 02:26 PM
Ah, turns out that you can simply point to a function which returns a localized string.
So for example:
    filterable: {
                messages: {
                    info: getLocalizedInfoText(),
                },
                extra: false,
                operators: {
                    string: {
                        contains: getLocalizedContainsText(),
                    },
                    date: {
                        gt: getLocalizedGTText(),
                        lt: getLocalizedLTText()
                    }
                },
            },
0
Alexander Valchev
Telerik team
answered on 31 Jul 2014, 02:48 PM
Hello Martin,

This topic is from 2012 and is outdated. With the latest official release we provided a way for localizing Kendo widgets' messages through external file. For more information please check the this help topic and this demo page.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Vladimir
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Martin
Top achievements
Rank 1
Share this question
or