.open() in setTimeout Failed to execute 'removeChild' on 'Node'

8 posts, 0 answers
  1. Baptiste
    Baptiste avatar
    4 posts
    Member since:
    May 2016

    Posted 31 May Link to this post

    Hi,

    I have an issue on my multiselect.

    When I select a value in my MultiSelect, everything is OK. (leave thefield whithout error).

    But, when I re-focus the multiselect to add another value, I get a JS error : kendo.web.min.js:41 Uncaught TypeError: Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'.

    I try to put the setTimeout to 250 instead of 0 and it seems to work but I'm afraid that when I have a lot of datas to load it will explode again...

            setTimeout(function () {
                var multiselect = $multiselect.data("kendoMultiSelect");
                multiselect.open();
            }, 0);

    Any idea ?
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 02 Jun Link to this post

    Hello Baptiste,

    The error will be thrown when there are mismatch between the selected and rendered items (state of the datasource). Would it be possible to send us a simplified demo that demonstrates the issue? Thus we will be able to review the implementation and find the cause of the erroneous behavior much faster.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Baptiste
    Baptiste avatar
    4 posts
    Member since:
    May 2016

    Posted 02 Jun in reply to Georgi Krustev Link to this post

    Hello Georgi,

            var vals = model.Valeur ? model.Valeur.split(";").map(Number) : [];

            var $multiselect = input.kendoMultiSelect({
                autobind: false,
                change: function (e) {
                    var result = this.dataItems();

                    model.set("Val", this.value().join(";"));
                },
                dataValueField: valueField,
                dataTextField: textField,
                dataSource: {
                    transport: {
                        read: {
                            url: url,
                            type: "GET"
                        }
                    },
                    pageSize: 100,
                    type: "aspnetmvc-ajax",
                    schema: {
                        data: "Data",
                        total: "Total",
                        errors: "Errors",
                        model: {
                            id: valueField,
                            fields: fields
                        }
                    },
                    requestEnd: requestEnd,
                    fetch: function () {
                        this.sync();
                    }
                },
                itemTemplate: itemTemplate,
                highlightFirst: false,
                value: vals
            });

            setTimeout(function () {
                var multiselect = $multiselect.data("kendoMultiSelect");
                multiselect.open();
            }, 0);

    Is it enough ?
  5. Baptiste
    Baptiste avatar
    4 posts
    Member since:
    May 2016

    Posted 02 Jun in reply to Baptiste Link to this post

    Hi,

    I'm doing some tests and i'm seeing many errors on my code. So, it'll more usefull to explain what i need.

    I use the multiSelect in a kendo grid. When i click on the cell, the editor is created but i need the multiselect open as soon as possible (it's more user friendly in my case). 

    What is the best way to do that ? I tried with setTimeout and open methode with server paging and multiSelect's virtual option but it don't work. Current values are removed.

    You can see it in this fiddle : https://jsfiddle.net/muadhib/kq9q41m7/

     

  6. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    355 posts

    Posted 06 Jun Link to this post

    Hi Baptiste,

    There are two options for the value binding behavior of the Kendo UI MultiSelect - the value should be either a collection of objects, similar to the data items from the widget's dataSource, or a primitive value, matching the selected item(s) value field(s):

    http://docs.telerik.com/kendo-ui/api/javascript/ui/multiselect#configuration-valuePrimitive

    In the discussed scenario either the value option should be set to an array of objects, e.g.:

    value: [{OrderID: 10265}, {OrderID:10289}, {OrderID: 10415}]

    ... or valuePrimitive should be set to true.

    If you need the MultiSelect to open as soon as the dataItems are loaded, you can handle the dataBound event, and call the open() method in the handler:

    I have modified the provided example to illustrate the described suggestions:

    https://jsfiddle.net/kq9q41m7/2/

    I hope this helps.

    Regards,
    Dimiter Topalov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  7. Baptiste
    Baptiste avatar
    4 posts
    Member since:
    May 2016

    Posted 08 Jun Link to this post

    Hi Dimiter,

     

    It's help me ! :)

    Now, it's work perfectly. I don't know why i have'nt try databound before, and yet it was so easy to found.

     

    Thx.

  8. Desu
    Desu avatar
    1 posts
    Member since:
    Dec 2014

    Posted 23 Aug in reply to Georgi Krustev Link to this post

    Hi Georgi,

    Sorry to reply on old post but i wanted to know a little bit more about your statement "The error will be thrown when there are mismatch between the selected and rendered items (state of the datasource)", since i also encounter the same error message but at a different scenario.

    is there any attribute on the datasource that i can observe regarding this matter. On my scenario i'm creating a custom multiselect widget and also my project already contains lot of customization to the kendo ui widget and i believe there is "bad code" in the costumization code that is causing this problem.

  9. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 25 Aug Link to this post

    Hello Desu,

    I stated that if there are unsynced data list in the widget (added, removed items), it could throw an exception. The real cause could have different sources, that is why we will need a repro demo in order to continue with the investigation. Could you send us such repro demo?

    Regards,
    Georgi Krustev
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top
Kendo UI is VS 2017 Ready