Hello Friends,
I've to dynamically & constatly (depending on what user selectes in another dropdown) keep disabling one item. This worked well ... but then if the user selects another item, the former one obiously stays disabled, so I tried to iterate thru all items and explicitly enable each one (if there is a better and efficient possible scenario, please psot with code example)
Also please let me know how can I "unselect" the item ... as this combobox has checkboxes visible
I tried following w/o suuceess
I am using folllowing code (hopefully this will also provide a good reference like I got referecne from : this post)
Thanks,
-Aarsh
I've to dynamically & constatly (depending on what user selectes in another dropdown) keep disabling one item. This worked well ... but then if the user selects another item, the former one obiously stays disabled, so I tried to iterate thru all items and explicitly enable each one (if there is a better and efficient possible scenario, please psot with code example)
Also please let me know how can I "unselect" the item ... as this combobox has checkboxes visible
I tried following w/o suuceess
item.select =
false
;
and
ddadditionalCaseTypes.Items[i].Selected =
false
;
I am using folllowing code (hopefully this will also provide a good reference like I got referecne from : this post)
Thanks,
-Aarsh
function
jsfun_CategoryTypeChanged() {
var
CategoryTypesID, additionalCategoryTypesID, selectedValue, ddadditionalCategoryTypes;
CategoryTypesID =
"#ctl00_ContentPlaceHolder1_ddCategoryTypes"
;
additionalCategoryTypesID =
"#ctl00_ContentPlaceHolder1_ddAdditionalCategoryTypes"
;
ddadditionalCategoryTypes = $find(
"ctl00_ContentPlaceHolder1_ddAdditionalCategoryTypes"
);
debugger;
var
allItems = ddadditionalCategoryTypes.get_items();
for
(
var
i = 0; i < allItems.get_count(); i++) {
var
thisItem = ddadditionalCategoryTypes.get_items().getItem(i);
if
(thisItem !=
null
)
thisItem.enable();
}
selectedValue = $(CategoryTypesID).val();
if
(ddadditionalCategoryTypes !=
null
) {
var
item = ddadditionalCategoryTypes.findItemByValue(selectedValue);
if
(item !=
null
) {
ddadditionalCategoryTypes.commitChanges();
item.disable();
ddadditionalCategoryTypes.trackChanges();
}
}
}