* @cfg {boolean} hover Add hover highlighting
* @cfg {boolean} condensed Format condensed
* @cfg {boolean} responsive Format condensed
+ * @cfg {Boolean} loadMask (true|false) default false
*
-
+ * @cfg {Roo.bootstrap.PagingToolbar} footer a paging toolbar
*
* @constructor
this.sm.xmodule = this.xmodule || false;
}
if (this.cm && typeof(this.cm.config) == 'undefined') {
- this.colModel = new Roo.bootstrap.Table.ColumnModel(this.cm);
+ this.colModel = new Roo.grid.ColumnModel(this.cm);
this.cm = this.colModel;
this.cm.xmodule = this.xmodule || false;
}
this.ds.xmodule = this.xmodule || false;
}
+ if (this.footer && this.store) {
+ this.footer.dataSource = this.ds;
+ this.footer = Roo.factory(this.footer);
+ }
};
Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, {
sm : false,
cm : false,
store : false,
+ loadMask : false,
getAutoCreate : function(){
var cfg = Roo.apply({}, Roo.bootstrap.Table.superclass.getAutoCreate.call(this));
// this.maskEl.enableDisplayMode("block");
// this.maskEl.show();
+ this.parent().el.setStyle('position', 'relative');
+ if (this.footer) {
+ this.footer.parentId = this.id;
+ this.footer.onRender(this.el.select('tfoot tr td').first(), null);
+ }
+
+
+ // mask should be using Roo.bootstrap.Mask...
+
+ var mark = {
+ tag: "div",
+ cls:"x-dlg-mask",
+ style: "text-align:center",
+ cn: [
+ {
+ tag: "div",
+ style: "background-color:white;width:50%;margin:100 auto; display:none",
+ cn: [
+ {
+ tag: "img",
+ src: Roo.rootURL + '/images/ux/lightbox/loading.gif'
+ },
+ {
+ tag: "span",
+ html: "Loading"
+ }
+
+ ]
+ }
+ ]
+ }
+ this.maskEl = Roo.DomHelper.append(document.body, mark, true);
+
+ var size = this.parent().el.getSize();
+
+ this.maskEl.setSize(size.width, 300); // we will fix the height at the beginning...
+
+ this.maskEl.enableDisplayMode("block");
+
this.store.on('load', this.onLoad, this);
this.store.on('beforeload', this.onBeforeLoad, this);
- this.store.load();
+ // load should be trigger on render..
+ //this.store.load();
var config = cm.config[i];
+ if(typeof(config.hidden) != 'undefined' && config.hidden){
+ continue;
+ }
+
var c = {
tag: 'th',
html: cm.getColumnHeader(i)
}
if(typeof(config.width) != 'undefined'){
- c.style = 'width:' + config.width;
+ c.style = 'width:' + config.width + 'px';
}
header.cn.push(c)
{
var footer = {
tag: 'tfoot',
- cn : []
+ cn : [
+ {
+ tag: 'tr',
+ cn : [
+ {
+ tag : 'td',
+ colspan : 1
+ }
+ ]
+ }
+ ]
};
return footer;
var tbody = this.el.select('tbody', true).first();
var renders = [];
-
+
if(this.store.getCount() > 0){
this.store.data.each(function(d){
var row = {
};
for(var i = 0, len = cm.getColumnCount(); i < len; i++){
- var renderer = cm.getRenderer(i);
var config = cm.config[i];
+
+ if(typeof(config.hidden) != 'undefined' && config.hidden){
+ continue;
+ }
+
+ var renderer = cm.getRenderer(i);
var value = '';
var id = Roo.id();
};
if(typeof(config.width) != 'undefined'){
- td.width = config.width;
+ td.style = 'width:' + config.width + 'px';
}
row.cn.push(td);
_this.renderColumn(r);
})
}
-//
-// if(this.loadMask){
-// this.maskEl.hide();
-// }
+
+ if(this.loadMask){
+ this.maskEl.hide();
+ }
},
onBeforeLoad : function()
this.clear();
-// if(this.loadMask){
-// this.maskEl.show();
-// }
+ if(this.loadMask){
+ this.maskEl.show();
+ }
},
clear : function()