Having issues manually adding data to remote data source

4 posts, 0 answers
  1. Andy
    Andy avatar
    4 posts
    Member since:
    Jul 2014

    Posted 22 Jan 2015 Link to this post

    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
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 26 Jan 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Andy
    Andy avatar
    4 posts
    Member since:
    Jul 2014

    Posted 27 Jan 2015 in reply to Georgi Krustev Link to this post

    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?
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 29 Jan 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready