forked from 0x2620/oxjs
workaround for select values not getting updated correctly when updating form values
This commit is contained in:
parent
e5d0c3fd20
commit
f43122f795
4 changed files with 39 additions and 24 deletions
|
|
@ -43,11 +43,12 @@ Ox.Select = function(options, self) {
|
|||
size: 'medium',
|
||||
title: '',
|
||||
type: 'text', // can be 'text' or 'image'
|
||||
value: [],
|
||||
value: '',
|
||||
width: 'auto'
|
||||
})
|
||||
// fixme: make default selection restorable
|
||||
// or allow for extra action items below options
|
||||
// fixme: passing value has no effect
|
||||
.options(options)
|
||||
.addClass(
|
||||
'OxSelect Ox' + Ox.toTitleCase(self.options.size) + (
|
||||
|
|
@ -148,6 +149,7 @@ Ox.Select = function(options, self) {
|
|||
function changeMenu(data) {
|
||||
//Ox.print('clickMenu: ', self.options.id, data)
|
||||
self.checked = self.optionGroup.checked();
|
||||
self.options.value = data.checked[0].id;
|
||||
self.$title && self.$title.html(
|
||||
self.options.title ? self.options.title :
|
||||
data.checked[0].title
|
||||
|
|
@ -182,6 +184,8 @@ Ox.Select = function(options, self) {
|
|||
}
|
||||
};
|
||||
|
||||
// FIXME: selected() _and_ selectItem() _and_ value() ???
|
||||
|
||||
/*@
|
||||
selected <f> gets selected item
|
||||
() -> <o> returns object of selected items with id, title
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue