123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
"use strict";
modulum('TableColumnRowBoundWidget', ['TableColumnWidget', 'WidgetFactory'],
function(context, cls) {
cls.TableColumnRowBoundWidget = context.oo.Class(cls.TableColumnWidget, function($super) {
return {
__name: "TableColumnRowBoundWidget",
__templateName: "TableColumnWidget",
$static: {
minWidth: 24
},
_initElement: function() {
$super._initElement.call(this);
this.getTitleWidget().onReorderingDrop = Function.noop;
this.getTitleWidget().onReorderingDragOver = Function.noop;
this.getTitleWidget()._buildContextMenu = Function.noop;
},
destroy: function() {
var children = this.getChildren();
if (children) {
for (var i = children.length - 1; i > -1; i--) {
var currentChildren = children[i];
currentChildren.destroyChildren();
currentChildren.destroy();
currentChildren = null;
}
}
$super.destroy.call(this);
},
updateRowsVisibility: function() {
var visibleRows = this.getParentWidget().getVisibleRows();
var children = this.getChildren();
while (children.length < visibleRows) {
var rowBoundDecorator = cls.WidgetFactory.createWidget("RowBoundDecorator", this.getBuildParameters());
this.addChildWidget(rowBoundDecorator);
}
$super.updateRowsVisibility.call(this);
},
measureSize: function() {},
setWidth: function(width) {
width = Math.max(width, cls.TableColumnRowBoundWidget.minWidth);
$super.setWidth.call(this, width);
},
isMovable: function() {
return false;
},
isSizable: function() {
return false;
},
isAlwaysVisible: function() {
return true;
}
};
});
cls.WidgetFactory.registerBuilder('TableColumnRowBound', cls.TableColumnRowBoundWidget);
});