use disabled attribute in select source, fix #287
This commit is contained in:
		@@ -33,12 +33,19 @@ $(function(){
 | 
				
			|||||||
            this.$input.empty();
 | 
					            this.$input.empty();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var fillItems = function($el, data) {
 | 
					            var fillItems = function($el, data) {
 | 
				
			||||||
 | 
					                var attr;
 | 
				
			||||||
                if($.isArray(data)) {
 | 
					                if($.isArray(data)) {
 | 
				
			||||||
                    for(var i=0; i<data.length; i++) {
 | 
					                    for(var i=0; i<data.length; i++) {
 | 
				
			||||||
 | 
					                        attr = {};
 | 
				
			||||||
                        if(data[i].children) {
 | 
					                        if(data[i].children) {
 | 
				
			||||||
                           $el.append(fillItems($('<optgroup>', {label: data[i].text}), data[i].children)); 
 | 
					                            attr.label = data[i].text;
 | 
				
			||||||
 | 
					                            $el.append(fillItems($('<optgroup>', attr), data[i].children)); 
 | 
				
			||||||
                        } else {
 | 
					                        } else {
 | 
				
			||||||
                           $el.append($('<option>', {value: data[i].value}).text(data[i].text)); 
 | 
					                            attr.value = data[i].value;
 | 
				
			||||||
 | 
					                            if(data[i].disabled) {
 | 
				
			||||||
 | 
					                                attr.disabled = true;
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                            $el.append($('<option>', attr).text(data[i].text)); 
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user