*
* @cfg {String} cls table class
*
- *
+ *
+ * @cfg {string} empty_results Text to display for no results
* @cfg {boolean} striped Should the rows be alternative striped
* @cfg {boolean} bordered Add borders to the table
* @cfg {boolean} hover Add hover highlighting
* also adds table-responsive (see bootstrap docs for details)
* @cfg {Boolean} loadMask (true|false) default false
* @cfg {Boolean} footerShow (true|false) generate tfoot, default true
+ * @cfg {Boolean} summaryFooterShow (true|false) generate tfoot for summary, default false
* @cfg {Boolean} headerShow (true|false) generate thead, default true
* @cfg {Boolean} rowSelection (true|false) default false
* @cfg {Boolean} cellSelection (true|false) default false
* @cfg {Boolean} lazyLoad auto load data while scrolling to the end (default false)
* @cfg {Boolean} auto_hide_footer auto hide footer if only one page (default false)
* @cfg {Boolean} enableColumnResize default true if columns can be resized = needs scrollBody to be set to work (drag/drop)
+ * @cfg {Boolean} disableAutoSize disable autoSize() and initCSS()
+ *
*
* @cfg {Number} minColumnWidth default 50 pixels minimum column width
*
cls: false,
+ empty_results : '',
striped : false,
scrollBody : false,
bordered: false,
store : false,
loadMask : false,
footerShow : true,
+ summaryFooterShow : false,
headerShow : true,
enableColumnResize: true,
+ disableAutoSize: false,
rowSelection : false,
cellSelection : false,
cfg.cn.push(this.renderBody());
- if(this.footerShow){
+ if(this.footerShow || this.summaryFooterShow){
cfg.cn.push(this.renderFooter());
}
+
// where does this come from?
//cfg.cls+= ' TableGrid';
}
initCSS : function()
{
-
+ if(this.disableAutoSize) {
+ return;
+ }
var cm = this.cm, styles = [];
this.CSS.removeStyleSheet(this.id + '-cssrules');
return footer;
},
-
-
onLoad : function()
{
// Roo.log('ds onload');
if(ds.getCount() > 0){
ds.data.each(function(d,rowIndex){
var row = this.renderRow(cm, ds, rowIndex);
+
+ Roo.log("ROW");
+ Roo.log(row);
tbody.createChild(row);
}
}, this);
+ } else if (this.empty_results.length) {
+ this.el.mask(this.empty_results, 'no-spinner');
}
var tfoot = this.el.select('tfoot', true).first();
this.mainFoot.show();
}
}
+
+ if(!this.footerShow && this.summaryFooterShow) {
+
+ var tr = {
+ tag : 'tr',
+ cn : []
+ };
+
+ for(var i = 0, len = cm.getColumnCount(); i < len; i++){
+
+ var value = cm.config[i].summaryFooter;
+
+ Roo.log('value [' + i + '] : ' + value);
+
+ var td = {
+ tag: 'td',
+ cls : ' x-fcol-' + i,
+ style: '',
+ html: cm.config[i].summaryFooter
+ };
+
+ }
+
+ tfoot.createChild(row);
+
+ var _this = this;
+
+ if(row.cellObjects.length){
+ Roo.each(row.cellObjects, function(r){
+ _this.renderCellObject(r);
+ })
+ }
+ }
Roo.each(this.el.select('tbody td', true).elements, function(e){
e.on('mouseover', _this.onMouseover, _this);
onBeforeLoad : function()
{
-
+ this.el.unmask(); // if needed.
},
/**
* Remove all rows
*/
autoSize : function()
{
+ if(this.disableAutoSize) {
+ return;
+ }
//var ctr = Roo.get(this.container.dom.parentElement);
var ctr = Roo.get(this.el.dom);