table list columns: add 'addable' property (defaults to true, like removable)

This commit is contained in:
rlx 2013-07-20 07:57:13 +00:00
parent 8c6803dc0e
commit ce579b8f3f

View file

@ -7,12 +7,13 @@ Ox.TableList <f> TableList Widget
clearButtonTooltip <s|''> Clear button tooltip
columns <[o]|[]> Columns
# Fixme: There's probably more...
addable <b|true> ...
align <s|'left'> ...
editable <b> ...
format <f> ...
id <s> ...
operator <s> default sort operator
removable <b> ...
removable <b|true> ...
resizable <b> ...
sort <f> function(value, object) that maps values to sort values
title <s> ...
@ -211,7 +212,9 @@ Ox.TableList = function(options, self) {
if (self.options.columnsRemovable) {
that.$select = Ox.Select({
id: self.options.id + 'SelectColumns',
items: self.options.columns.map(function(column) {
items: self.options.columns.filter(function(column){
return column.addable !== false;
}).map(function(column) {
return {
disabled: column.removable === false,
id: column.id,
@ -489,7 +492,7 @@ Ox.TableList = function(options, self) {
$('<div>').appendTo($resize);
$('<div>').addClass('OxCenter').appendTo($resize);
$('<div>').appendTo($resize);
// if columns are resizable, bind click and drag events
// if columns are resizable, bind doubleclick and drag events
if (self.options.columnsResizable && column.resizable !== false) {
$resize.addClass('OxResizable')
.bindEvent({