Grid / Filter Multi Checkboxes with Dynamic Columns

2 posts, 0 answers
  1. Neil
    Neil avatar
    28 posts
    Member since:
    Aug 2016

    Posted 18 May Link to this post

    I'm trying to implement filter checkboxes with my dynamic column grid. I return a List<string> of options that I retrieve based on the PropertyName that I pass to the read action of the Filterable property.

    I keep getting the following javascript error, where X33 is the generic column name that is mapped to the actual data column. Any advice would be great.

    VM2049:3 Uncaught ReferenceError: X33 is not defined
        at eval (eval at compile (kendo.all.min.js:25), <anonymous>:3:209)
        at Object.render (kendo.all.min.js:25)
        at Object.d [as render] (jquery.min.js:2)
        at init.createCheckBoxes (kendo.all.min.js:43)
        at init.refresh (kendo.all.min.js:43)
        at init.options.forceUnique.checkChangeHandler (kendo.all.min.js:43)
        at init.trigger (kendo.all.min.js:25)
        at init._process (kendo.all.min.js:28)
        at init.success (kendo.all.min.js:27)
        at success (kendo.all.min.js:27)
     

    Here is the relevant code for setting up the columns.

    foreach (ColumnSettings col in Model.GridColumns)
    {
         columns.Bound(col.PropertyName).Title(col.Title).Width(col.Width).Filterable(ftb => ftb.Multi(true)
             .DataSource(ds => ds.Read(r => r.Action("Unique", "Data").Data("{ field: '" + col.PropertyName + "' }"))));
    }

     

  2. Preslav
    Admin
    Preslav avatar
    181 posts

    Posted 22 May Link to this post

    Hello Neil,

    The provided code snippet looks good to me. Based on it, I am not sure what might be the cause for this issue.

    That said, could you please elaborate on the issue and provide the whole definition of the Grid? 

    In the meantime, you could check our "Filter Multi Checkboxes" demo: 

    http://demos.telerik.com/aspnet-mvc/grid/filter-multi-checkboxes

    I look forward to your reply.


    Regards,
    Preslav
    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.
Back to Top