dojo.require('openils.widget.AutoFieldWidget');
dojo.require('openils.widget.EditPane');
dojo.require('openils.widget.EditDialog');
+ dojo.require('openils.widget.GridColumnPicker');
dojo.require('openils.Util');
dojo.declare(
suppressFields : null,
hideSelector : false,
selectorWidth : '1.5',
+ showColumnPicker : false,
+ columnPickerPrefix : null,
/* by default, don't show auto-generated (sequence) fields */
showSequenceFields : false,
this.initAutoEnv();
this.attr('structure', this._compileStructure());
this.setStore(this.buildAutoStore());
+
+ if(this.showColumnPicker) {
+ if(!this.columnPickerPrefix) {
+ console.error("No columnPickerPrefix defined");
+ } else {
+ new openils.widget.GridColumnPicker(
+ openils.User.authtoken, this.columnPickerPrefix, this).load();
+ }
+ }
+
this.overrideEditWidgets = {};
this.overrideEditWidgetClass = {};
+
if(this.editOnEnter)
this._applyEditOnEnter();
else if(this.singleEditStyle)
formatter : function(rowIdx) { return self._formatRowSelectInput(rowIdx); },
get : function(rowIdx, item) { if(item) return rowIdx; },
width : this.selectorWidth,
- name : '✓'
+ name : '✓',
+ nonSelectable : true
});
}
var selector = dojo.query('[name=selector]', row)[0];
var width = dojo.query('[name=width]', row)[0];
if(selector.checked && selector.getAttribute('ident') == cell.field+''+cell.name) {
- if(width.checked)
+ if(width.checked) {
cell.width = 'auto';
- else delete cell.width;
+ } else {
+ if(cell.width == 'auto')
+ cell.width;
+ }
newCellList.push(cell);
}
}
if(cell.selectableColumn) {
if(this._arrayHas(setting.columns, cell.field)) {
newCellList.push(cell);
- if(this._arrayHas(setting.auto, cell.field))
+ if(this._arrayHas(setting.auto, cell.field)) {
cell.width = 'auto';
- else delete cell.width;
+ } else {
+ if(cell.width == 'auto')
+ delete cell.width;
+ }
}
} else { // if it's not selectable, always show it
newCellList.push(cell);