Remove Multiples

2 posts, 0 answers
  1. Kailash
    Kailash avatar
    1 posts
    Member since:
    Dec 2014

    Posted 06 Dec 2014 Link to this post

    I am using Kendo UI Multiselect and have this Data:

    var data =
    [
    { text: "Shirt-Black", value: "1" },
    { text: "Shirt-Brown", value: "2" },
    { text: "Shirt-Blue", value: "3" },
    { text: "Cap-Green", value: "4" },
    { text: "Cap-Red", value: "5" },
    { text: "Cap-White", value: "6" },
    { text: "Jacket-Denim", value: "7" }
    ];

    Now I want that if I select "Shirt-Brown" then rest entries for shirt i.e. "Shirt-Black" and "Shirt-Blue" should not appear in the list which means that the user should not be able to choose the Shirt of two colors.Similarly, If a "Cap" of any color has been chosen then user should not be able to choose the "Cap" of any other color.

    Is there any way to achieve this?
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 10 Dec 2014 Link to this post

    Hi Kailash,

    This behavior is currently not supported out of the box. You can achieve similar results by subscribing to the MultiSelect's select event, checking the dataItems and if necessary - updating the value, so there are no two items from the same group. 

    Regards,
    Alexander Popov
    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
Back to Top