Grid mvc filter settings not work with localization

14 posts, 1 answers
  1. Sergey
    Sergey avatar
    8 posts
    Member since:
    Nov 2016

    Posted 20 Dec 2016 Link to this post

    Hi, version kendo ui 2016.3.1118, using Russian localization (Turkish works equally) the setting:

    .Filterable(filterable => filterable
            .Extra(false)
            .Operators(operators => operators
                .ForString(str => str.Clear()
                    .StartsWith("Starts with")
                    .IsEqualTo("Is equal to")
                    .IsNotEqualTo("Is not equal to")
                ))
            )

    simply does not work, instead of the three operators (specified in settings) displays all.  If you include the localization of the default(en-EN) is all works.
    Full Code:

    bundles.Add(new ScriptBundle("~/bundles/kendoJs").Include("~/Scripts/kendo/2016.3.1118/kendo.all.min.js")
                                                                 .Include("~/Scripts/kendo/2016.3.1118/kendo.aspnetmvc.min.js")
                                                                 .Include("~/Scripts/kendo/2016.3.1118/cultures/kendo.culture.ru-RU.min.js"));
    <system.web>
        <globalizationculture="ru-Ru" uiCulture="ru-Ru" />
    </system.web>
    kendo.culture("ru-RU");
     @(Html.Kendo().Grid<CertificateDeath>()
        .Name("Grid")
        .Columns(columns =>  {
           columns.Bound(e => e.Name).Width(200);
            columns.Bound(e => e.NameShort).Width(350);
        })
        .Filterable(filterable => filterable
            .Extra(false)
            .Operators(operators => operators
                .ForString(str => str.Clear()
                    .StartsWith("Starts with")
                    .IsEqualTo("Is equal to")
                    .IsNotEqualTo("Is not equal to")
                ))
            )
        .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("List", "CertificateDeath"))
         )
        )
    I would be grateful for any help.

  2. Pavlina
    Admin
    Pavlina avatar
    6115 posts

    Posted 22 Dec 2016 Link to this post

    Hello,

    I have tested the grid globalization in the demo below and after I selected Russian culture it applies properly for the filter settings:
    http://demos.telerik.com/aspnet-mvc/grid/globalization?culture=ru-RU

    Please check it out and see what is the difference on your end.

    Regards,
    Pavlina
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Sergey
    Sergey avatar
    8 posts
    Member since:
    Nov 2016

    Posted 22 Dec 2016 in reply to Pavlina Link to this post

    Hello Pavlina,

    http://screencast.com/t/2x50rrrjN8m

    For russia culture not working "settings operators filter" and not the filter itself. In the settings have three operators for the data type "string", but why display all operators?

  4. Eyup
    Admin
    Eyup avatar
    3095 posts

    Posted 26 Dec 2016 Link to this post

    Hello Sergey,

    As for the localization issue, generally the grid component provides globalization:
    http://demos.telerik.com/kendo-ui/grid/localization

    They are controlled by the grid messages:
    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-filterable.operators.string.isnull

    You can also check the following article:
    http://docs.telerik.com/kendo-ui/framework/localization/overview


    In your specific case it might be due to some general localization which you use and overrides these properties.

    Regards,
    Eyup
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Sergey
    Sergey avatar
    8 posts
    Member since:
    Nov 2016

    Posted 27 Dec 2016 in reply to Eyup Link to this post

    Hello Eyup, 

    Links that you sent I read otherwise would not write to the forum. If you use javascript all work but not work for mvc helper

    http://www.screencast.com/t/2x50rrrjN8m

  6. Eyup
    Admin
    Eyup avatar
    3095 posts

    Posted 29 Dec 2016 Link to this post

    Hello Sergey,

    In that case please modify the attached web site sample to demonstrate the exact problematic behavior and send it back to us so we can provide a solid and accurate solution.

    Regards,
    Eyup
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. Sergey
    Sergey avatar
    8 posts
    Member since:
    Nov 2016

    Posted 09 Jan in reply to Eyup Link to this post

    Hello Eyup

    could not attach the project, link on dropbox

    https://www.dropbox.com/s/sulypzbxcvw9nb5/KendoExample.zip?dl=0

  8. Sergey
    Sergey avatar
    8 posts
    Member since:
    Nov 2016

    Posted 16 Jan Link to this post

    Can somebody help me?
  9. Pavlina
    Admin
    Pavlina avatar
    6115 posts

    Posted 18 Jan Link to this post

    Hi,

    Thank you for the provided project. We will give it a try and will get back to you with our findings as soon as possible. 

    Regards,
    Pavlina
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  10. Sergey
    Sergey avatar
    8 posts
    Member since:
    Nov 2016

    Posted 27 Jan in reply to Pavlina Link to this post

    Can somebody help me?
  11. Eyup
    Admin
    Eyup avatar
    3095 posts

    Posted 30 Jan Link to this post

    Hi Sergey,

    Thanks for your immense patience about this matter. From now on, I am taking this case as a top priority and I will provide you almost instant replies so we can finish this project as quick as possible.

    You can resolve this behavior by applying this configuration directly to the column:
    columns.Bound(e => e.ProductName).Width(200).Filterable(f => f
            .Extra(false)
            .Operators(operators => operators
            .ForString(str => str.Clear()
               .StartsWith("Начинается")
               .IsEqualTo("Равно")
               .IsNotEqualTo("Не равно"))
    ));

    I've updated your Telerik points as a token of gratitute for bringing this issue to our attention. I will also forward this issue to our dev team for further investigation.

    Thank you once again for your understanding.

    Regards,
    Eyup
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  12. Sergey
    Sergey avatar
    8 posts
    Member since:
    Nov 2016

    Posted 07 Feb in reply to Eyup Link to this post

    Thank Eyup, for having paid attention to my problem. In this case, it does not solve the problem because I have a few GRID with large number of fields. Can I exclude these operators (not enumerating all that I need) https://www.screencast.com/t/XgHondh1XNpN and by applying this configuration directly to grid  or make globalization for this operator?  
  13. Answer
    Eyup
    Admin
    Eyup avatar
    3095 posts

    Posted 09 Feb Link to this post

    Hello Sergey,

    You can achieve this requirement using a general event for the entire grid:
    .Events(e=>e.FilterMenuInit("gridFilterInit"))
    JavaScript:
    <script>
        function gridFilterInit(args) {
            $(".k-filter-menu li.k-item:contains('Is')").hide();
        }
    </script>

    That should do the trick.

    Regards,
    Eyup
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  14. Sergey
    Sergey avatar
    8 posts
    Member since:
    Nov 2016

    Posted 15 Feb in reply to Eyup Link to this post

    Hi Eyup,

    Thanks for your help, the problem is solved.

Back to Top