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

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

9 Answers 433 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Baptiste
Top achievements
Rank 1
Baptiste asked on 31 May 2016, 10:07 AM

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 ?

9 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 02 Jun 2016, 08:07 AM
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!
 
0
Baptiste
Top achievements
Rank 1
answered on 02 Jun 2016, 08:17 AM

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 ?
0
Baptiste
Top achievements
Rank 1
answered on 02 Jun 2016, 01:06 PM

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/

 

0
Dimiter Topalov
Telerik team
answered on 06 Jun 2016, 09:09 AM
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!
 
0
Baptiste
Top achievements
Rank 1
answered on 08 Jun 2016, 07:23 AM

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.

0
Desu
Top achievements
Rank 1
answered on 23 Aug 2016, 06:56 AM

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.

0
Georgi Krustev
Telerik team
answered on 25 Aug 2016, 07:38 AM
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.
 
0
Mina
Top achievements
Rank 1
answered on 09 Jul 2019, 11:41 PM

I have the same problem only happens some times, can you send me ticket to see solution?

 

0
Ivan Danchev
Telerik team
answered on 11 Jul 2019, 02:59 PM
Hello Mina,

All the available information about the issue discussed in this thread is contained here. There is no related support ticket.

Regards,
Ivan Danchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
MultiSelect
Asked by
Baptiste
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Baptiste
Top achievements
Rank 1
Dimiter Topalov
Telerik team
Desu
Top achievements
Rank 1
Mina
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or