Disable FilteringSelect option

by psoares

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dijit/themes/claro/claro.css">
<select id="deptSelector"></select>

JavaScript

require([
    'dojo/aspect',
    'dijit/form/FilteringSelect',
    'dojo/store/Memory',
    'dojo/domReady!'
], function (aspect, FilteringSelect, Memory) {

    var departments = new Memory({
        data: [{
            id: 1,
            name: "Childcare Department",
            email: "[email protected]",
            disabled: true
        }, {
            id: 2,
            name: "Health Goods Department",
            email: "[email protected]"
        }, {
            id: 3,
            name: "Medicine Department",
            email: "[email protected]"
        }, {
            id: 4,
            name: "Customer Service",
            email: "[email protected]"
        }, {
            id: 5,
            name: "Other Department",
            email: "[email protected]"
        }]
    }),
        deptSelector = new FilteringSelect({
            store: departments,
            labelAttr: 'name'
        }, 'deptSelector');
 

    deptSelector.startup();
    aspect.after(deptSelector, 'openDropDown', function(){
        require(['dojo/query', 'dojo/NodeList-dom'], function(query){
            debugger;
            query(".dijitMenuItem[item=2]").addClass("dijitMenuItemDisabled").removeClass("dijitMenuItemSelected");
        });
        
    });
});