Skip to content

Instantly share code, notes, and snippets.

@j-mcnally
Created February 28, 2012 01:31
Show Gist options
  • Save j-mcnally/1928384 to your computer and use it in GitHub Desktop.
Save j-mcnally/1928384 to your computer and use it in GitHub Desktop.
Fixes verot's jquery select skin when using a ASP.NET dropdownlist that has Ajax Toolkit's Cascading Drop Downs
Sys.Application.add_load(function () {
var bound = [];
_.each(_.keys(Sys.Application._components), function (i) {
var q = Sys.Application._components[i];
if (q._name == "CascadingDropDownBehavior") {
if (bound.indexOf(q._id < 0)) {
q.add_populated(function (a, b, c) {
$(a._element).parent().siblings('.cmf-skinned-text').text('');
$(a._element).siblings('.cmf-skinned-text').text(a._element.options[a._element.selectedIndex].text);
});
}
bound.push(q._id);
}
});
$('select').select_skin('cmf-skinned-select');
$('select.skinned_large').select_skin('cmf-skinned-select-large');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment