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

Having issues manually adding data to remote data source

3 Answers 155 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 22 Jan 2015, 11:11 PM
I am trying to manually add data to a remote data source. I can add the data and then have the value selected, but the data doesn't seem to sync up. 

$('#idhere').data('kendoMultiSelect').dataSource.add({
 id: 'id',
 value: 'value'
});
$('#idhere').data('kendoMultiSelect').dataSource.sync();
$('#idhere').data('kendoMultiSelect').value('id');

I can see the value in the multiselect, but when I click the x to delete the item from the multiselect I get an error in the console that says: "Uncaught TypeError: Cannot read property 'id' of undefined"

When I break in the code at the line where I call the value() function and check the data source by doing:
$('#idhere').data('kendoMultiSelect').dataSource I can see the value, but when I continue the debugger, a few seconds later when I do the same query I don't see any values in the datasource from the same query.

It looks like someone else is having the same problem that I am: https://stackoverflow.com/questions/27561844/adding-data-after-initialization-of-kendo-ui-multiselect

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 26 Jan 2015, 09:22 AM
Hello Andy,

Based on the given information, I suppose that the data source and its service are not configured correctly for CRUD operations. Could you verify that the data source itself adds and syncs the data item correctly? If it works then the widget itself should work too.

If you are experience any difficulties with the implementation, I will ask you to send us a simple demo that demonstrates current implementation. This will help us to understand the case and provide a proper solution.

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
Andy
Top achievements
Rank 1
answered on 27 Jan 2015, 11:35 PM
Hi Georgi, The data source is read only, I'm trying to populate initial values from a local source, because the widget appears in a popup modal after values are set elsewhere on the screen. So I have a list of IDs that I need to prepopulate the multiselect with. I need to initially populate the list locally but still keep the remote read. How can I do this?
0
Georgi Krustev
Telerik team
answered on 29 Jan 2015, 09:15 AM
Hello Andy,

In order to provide an end-to-end solution, I will need to review the implementation locally. Could you prepare a simple Dojo demo that demonstrates the issue you are experiencing and what exactly you would like to achieve? Understanding the problem better will help us to provide a solution 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!
 
Tags
MultiSelect
Asked by
Andy
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Andy
Top achievements
Rank 1
Share this question
or