kendo ui - KendoUI Multiselect Remove Multiple -


i using kendo ui multiselect: http://demos.kendoui.com/web/multiselect/events.html

i have 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 want if select "shirt-brown" rest entries shirt i.e. "shirt-black" , "shirt-blue" should not appear in list means user should not able choose shirt of 2 colors.

similarly, if "cap" of color has been chosen user should not able choose "cap" of other color.

is there way achieve this?

this not build-in functionality. can't use datasource filter() method because remove selected items list well.

however, code you're asking:

$("#select").kendomultiselect({     ...     change: function(e) {       var dataitems = e.sender.dataitems();       var categories = [];        for(var = 0; < dataitems.length; i++){         var category = dataitems[i].text.substring(0, dataitems[i].text.indexof('-'));         categories.push(category);       }        e.sender.ul.find('li').each(function(index, value){         var $li = $(value);         var hidden = false;         for(var = 0; < categories.length; i++){           var category = categories[i];           if ($li.text().match("^" + category)){             $li.css('display', 'none');             hidden = true;           }         }         if(!hidden){           $li.css('display', 'list-item');         }       });     } }); 

working kendoui dojo: http://dojo.telerik.com/agisi


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -