Issue using value() method within change and select events

9 posts, 1 answers
  1. Nick
    Nick avatar
    31 posts
    Member since:
    Oct 2011

    Posted 25 Mar 2013 Link to this post

    This is mentioned in another post, but since it might be a bug, I thought a separate thread was appropriate.

    It seems like when I try to manipulate the data source (add and remove items), and then try to update the value() of the multiselect, it fails.

    This is demonstrated in this jsbin.  Note that in edit mode, for some reason jsbin does not allow inputting text into the multiselect (not sure if this is a jsbin bug or a kendo bug) - so you'll have to use the preview version to demonstrate the issue.

    http://jsbin.com/ucimay/3/edit
    http://jsbin.com/ucimay/3 (text input doesn't seem to work in edit mode, but works in preview mode)

    My main goal is to allow users to add new items to the multiselect.  As you will see from the example above, you can add one new item, but as you add more items, it only retains the most recent one.  For example, type "abc", then select that item.  Then type "def" and select that one.  Only "def" is selected.  I've confirmed that when I print the contents of the data source, both "abc" and "def" exist.  I've also confirmed that I'm passing ["abc","def"] to the value() method.

    Is this a bug that could be fixed with this week's internal build?

      Nick
  2. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 26 Mar 2013 Link to this post

    Hello Nick,

     
    The value method works as expected. It just accepts flat array of data and will not work with [value, newtag], where value is an array to. Also value method cannot select items which cannot be fined in the DataSource's view and that is why when you need to clear applied filter before setting values. Check the updated jsBin demo.

    On a side note, I will ask you to continue our conversion in only one thread in order to avoid any duplications.

    Regards,
    Georgi Krustev
    the Telerik team
    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. Nick
    Nick avatar
    31 posts
    Member since:
    Oct 2011

    Posted 26 Mar 2013 Link to this post

    Thanks Georgi,

    I actually view these as two separate issues, but I'll go ahead and mark this one as answered since it addresses the issue mentioned in the title, and I'll post one last thing in the other thread for the sake of other users who are interested in that use case.

      Nick
  5. Daniel
    Daniel avatar
    2 posts
    Member since:
    Nov 2012

    Posted 08 Jul in reply to Georgi Krustev Link to this post

    jsBin Demo does not work on newer Kendo versions.

    If I take the same jsBin Demo and just change the folder path to 2016.2.607 it erases the first new tag added when you try to add another new tag.

    Thanks

  6. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 12 Jul Link to this post

    Hello Daniel,

    Several major MultiSelect features were brought out through the years, which forced us to introduce some breaking changes in the widget implementation:

    http://docs.telerik.com/kendo-ui/backwards-compatibility/2015/2015-backward-compatibility

    Indeed, the jsBin demo does not work with the latest versions of Kendo UI due to the changes that I've already mentioned. In general, we do not guarantee backward compatibility to the custom solutions (not officially supported) shared in the forums and the developers should maintain the code on their own.

    For your convenience, I am sharing a how-to demo that demonstrates how to add new items into MultiSelect:

    http://dojo.telerik.com/@ggkrustev/UxOvO

    The demo uses the latest official release of Kendo UI. You can use it as a reference to accomplish your business requirement.

    As a side note, we are working on a better solution exactly for such integration between popup widgets and the need of CRUD operations. You can find more details here:

    http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/suggestions/4545733-multiselect-new-items

    Regards,
    Georgi Krustev
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  7. Daniel
    Daniel avatar
    2 posts
    Member since:
    Nov 2012

    Posted 12 Jul in reply to Georgi Krustev Link to this post

    Hello,

      The Dojo you posted does not appear to work. 

    Are you supposed to be able to dynamically add information to the multi select?  Right now it just filters when you type information in.

  8. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 14 Jul Link to this post

    Hello Daniel,

    The new custom item will be appended when a "," (comma) is typed. This is how the specific functionality is implemented in this how-to demo. As I mentioned in my previous response, you can use the demo as a reference to implement the desired functionality manually.

    If you need further assistance on this matter, then I would suggest you contact our Professional Services, which are specialized in such custom scenarios.

    Regards,
    Georgi Krustev
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  9. LST
    LST avatar
    1 posts
    Member since:
    Feb 2010

    Posted 24 Jul in reply to Georgi Krustev Link to this post

    Is there any way to prevent the tags from jumping positions when the user uses this function to add new item? Please see the following screencast (the tags start to go out of order after keying in the 3rd item):

    http://screencast.com/t/cj8cILTUj

     

  10. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 26 Jul Link to this post

    Hello,

    The order of the selected tags is directly related to the order of the data items in the dataItems collection. If the tags are shuffled, then the dataitems collection is shuffled too.

    In order to avoid this behavior, then you will need to take control over the orders of the selected data items. You can sort the dataItems collection and re-render the list after that.

    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