support for drag and drop

This commit is contained in:
rlx 2011-08-28 06:23:15 +00:00
commit 5d454f0a80
8 changed files with 39 additions and 11 deletions

View file

@ -48,6 +48,7 @@ Ox.TextList = function(options, self) {
columnsResizable: false,
columnsVisible: false,
columnWidth: [40, 800],
droppable: null,
id: '',
items: null, // function() {} {sort, range, keys, callback} or array
max: -1,
@ -380,7 +381,7 @@ Ox.TextList = function(options, self) {
function constructItem(data) {
var $item = $('<div>')
.addClass('OxTarget')
.addClass('OxTarget' + (data.droppable ? ' OxDroppable' : ''))
.css({
width: getItemWidth(true) + 'px'
});
@ -516,7 +517,7 @@ Ox.TextList = function(options, self) {
}
function getCell(id, key) {
Ox.print('getCell', id, key)
//Ox.print('getCell', id, key)
var $item = getItem(id);
key = key || '';
return $($item.find('.OxCell.OxColumn' + Ox.toTitleCase(key))[0]);
@ -847,7 +848,7 @@ Ox.TextList = function(options, self) {
that.value = function(id, key, value) {
// fixme: make this accept id, {k: v, ...}
Ox.print('value', id, key, value)
//Ox.print('value', id, key, value)
var $item = getItem(id),
$cell = getCell(id, key),
column = self.options.columns[getColumnIndexById(key)];