lost selected items after rebind

2 posts, 0 answers
  1. Matej
    Matej avatar
    1 posts
    Member since:
    Jul 2014

    Posted 09 Jan 2015 Link to this post

    I extend multiselect functionality with entering free text and after press ";" key i add item to datasource... Everything looks and works fine until i made kendo.bind (after save i reload data and make rebind - simulating this action on checkbox - primitivechanged). When I enter only one item its working fine, but when i enter more than one I lost everything except last item.

    Sometimes i get error 'Cannot read property 'style' of undefined' (in kendo.multiselect.js - _select: function...)

    Any suggestions on how to make this work?

  2. Georgi Krustev
    Georgi Krustev avatar
    3688 posts

    Posted 13 Jan 2015 Link to this post

    Hello Matej,

    I've answered to the support thread opened on the same subject. I would like to ask you continue our discussion in only one thread to avoid any duplication. Thank you for your understanding.

    Here is a quote of the answer:
    In general, adding a new item to the data source is not supported by the widget out-of-the-box and implementing and supporting custom modifications falls out of the scope of the entitled support service. 

    Nevertheless, I reviewed the provided demo and the problem comes from the fact that widget is being filtered (the data is reduced) when the form is re-bound. Hence it will select only the last item. This behavior can be overcome with manual filter cleaning in the widget change event handler:

    onChange: function(e) {
              if (e.sender.dataSource.filter()) {
    The modified file is attached to this message.

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top