1
0
Fork 0
forked from 0x2620/oxjs

improve listmap editing functionality

This commit is contained in:
rolux 2011-05-24 12:44:34 +02:00
commit 02442a24f7
6 changed files with 81 additions and 56 deletions

View file

@ -1240,11 +1240,16 @@ Ox.List = function(options, self) {
}
self.setOption = function(key, value) {
//Ox.print('list onChange', key, value);
Ox.print('list setOption', key, value);
if (key == 'items') {
updateQuery();
if (Ox.typeOf(value) == 'array') {
loadItems();
updateSort();
} else {
updateQuery();
}
} else if (key == 'selected') {
Ox.print('onChange selected', value)
Ox.print('setOption selected', value)
setSelected(value);
}
};

View file

@ -626,6 +626,7 @@ Ox.TextList = function(options, self) {
}
self.setOption = function(key, value) {
Ox.print('---------------------------- TextList setOption', key, value)
if (key == 'items') {
that.$body.options(key, value);
} else if (key == 'paste') {
@ -638,6 +639,14 @@ Ox.TextList = function(options, self) {
// fixme: doesn't work, doesn't return that
that.closePreview = that.$body.closePreview;
that.addItem = function(item) {
/*
self.options.items.push(item);
that.$body.options({items: self.options.items});
//that.$body.options({selected: [item.id]});
*/
}
that.editCell = function(id, key) {
Ox.print('editCell', id, key)
var $item = getItem(id),