adding change event for option groups, updating select

This commit is contained in:
Rolux 2010-02-09 17:55:42 +05:30
parent b8460e2ef9
commit fb7688b5b3

View File

@ -1753,12 +1753,13 @@ requires
.options(options)
.addClass("OxSelect Ox" + Ox.toTitleCase(self.options.size));
self.buttonId = self.options.id + "_button"
self.groupId = self.options.id + "_group"
self.menuId = self.options.id + "_menu",
$.each(self.options.items, function(i, item) {
self.options.items[i] = $.extend(self.options.items[i], {
checked: item.checked || false,
group: self.options.id,
group: self.groupId
});
if (item.checked) {
self.selected = i;
@ -1794,7 +1795,7 @@ requires
size: self.options.size
});
that.bindEvent("click_" + self.menuId, clickMenu);
that.bindEvent("change_" + self.groupId, clickMenu);
function clickButton() {
that.$menu.toggleMenu();
@ -2052,10 +2053,6 @@ requires
if (that.options("parent")) {
that.options("parent").hideMenu().triggerEvent("click");
}
Ox.Event.trigger("click_" + self.options.id, {
id: item.options("id"),
value: item.options("title")[0] // fixme: value or title?
});
if (item.options("checked") !== null && (!item.options("group") || !item.options("checked"))) {
item.options({
checked: !item.options("checked")