adding change event for option groups, updating select
This commit is contained in:
parent
aa80fc4d51
commit
ebf6072b54
1 changed files with 3 additions and 6 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue