ListBox in template or popup editor?

2 posts, 0 answers
  1. Michael
    Michael avatar
    13 posts
    Member since:
    Oct 2017

    Posted 01 Dec 2017 Link to this post

     

    I'm trying to put a listbox in a popup editor for a grid. However, whenever I do I get an error. It works fine in forms, base indexes, etc.

    Here is an example of the listbox I'm creating. It's very simple and impossible for it to have any object issues/etc. This thing literally should have zero problems.

    @(Html.Kendo().ListBox()
                .Name("optional")
                .Toolbar(toolbar =>
                {
                    toolbar.Position(Kendo.Mvc.UI.Fluent.ListBoxToolbarPosition.Right);
                    toolbar.Tools(tools => tools
                        .TransferTo()
                        .TransferFrom()
                        .TransferAllTo()
                        .TransferAllFrom()
                        .Remove()
                    );
                })
                .ConnectWith("selected")
                .BindTo(new List<string>() { "Test", "Test 2" })
    )

    @(Html.Kendo().ListBox()
                .Name("selected")
                .BindTo(new List<string>())
                .Selectable(ListBoxSelectable.Multiple)
    )

    However, when it's placed inside a template in the EditorTemplates folder I get this javascript error:

    kendo.all.js:9244 Uncaught TypeError: e.value is not a function
        at init.refresh (kendo.all.js:9244)
        at init.bind (kendo.all.js:8485)
        at r.applyBinding (kendo.all.js:9486)
        at r.bind (kendo.all.js:9436)
        at s (kendo.all.js:9579)
        at s (kendo.all.js:9588)
        at s (kendo.all.js:9588)
        at s (kendo.all.js:9588)
        at Object.a [as bind] (kendo.all.js:9603)
        at init.refresh (kendo.all.js:42964)

    I have absolutely no idea why. Can anyone explain to my why this happens or more importantly - how to get a listbox inside the editor popup for a grid?

  2. Stefan
    Admin
    Stefan avatar
    1778 posts

    Posted 05 Dec 2017 Link to this post

    Hello, Michael,

    Currently, the Kendo UI ListBox is not supported for a Grid editor and using it can create unexpected issues.

    We logged this in our backlog for further investigation, but the ETA may vary as it is a complex scenario.

    Also, when there are multiple values we can recommend using the MultiSelect widget as editor for the Grid:

    http://www.telerik.com/forums/multiselect-in-grid-popup-editor-not-binding-values-on-initial-load#4pe2HBdSkEGO6dn_esX7tg

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular 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