From 7d5229bb31815ff9ca162d00f00ad3cc98819584 Mon Sep 17 00:00:00 2001 From: Edward Date: Thu, 10 Jul 2014 14:00:44 +0800 Subject: [PATCH] Roo/bootstrap/Table.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/Table.js | 4 ++-- roojs-bootstrap-debug.js | 4 ++-- roojs-bootstrap.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Roo/bootstrap/Table.js b/Roo/bootstrap/Table.js index ba257d83c3..312c9b7204 100644 --- a/Roo/bootstrap/Table.js +++ b/Roo/bootstrap/Table.js @@ -296,7 +296,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, { } }); -// var tbody = this.el.select('tbody', true).first(); + var tbody = this.el.select('tbody', true).first(); var renders = []; @@ -360,7 +360,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, { { Roo.log('ds onBeforeLoad'); - this.clear(); +// this.clear(); // if(this.loadMask){ // this.maskEl.show(); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 98e1c5dc4b..7fe0e94349 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -3059,7 +3059,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, { } }); -// var tbody = this.el.select('tbody', true).first(); + var tbody = this.el.select('tbody', true).first(); var renders = []; @@ -3123,7 +3123,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, { { Roo.log('ds onBeforeLoad'); - this.clear(); +// this.clear(); // if(this.loadMask){ // this.maskEl.show(); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 51d915eddc..92a526bc04 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -80,9 +80,9 @@ Roo.bootstrap.Slider=function(A){Roo.bootstrap.Slider.superclass.constructor.cal Roo.bootstrap.Table=function(A){Roo.bootstrap.Table.superclass.constructor.call(this,A);if(this.sm){this.selModel=Roo.factory(this.sm,Roo.bootstrap.Table);this.sm=this.selModel;this.sm.xmodule=this.xmodule||false;}if(this.cm&&typeof(this.cm.config)=='undefined'){this.colModel=new Roo.bootstrap.Table.ColumnModel(this.cm);this.cm=this.colModel;this.cm.xmodule=this.xmodule||false;}if(this.store){this.store=Roo.factory(this.store,Roo.data);this.ds=this.store;this.ds.xmodule=this.xmodule||false;}};Roo.extend(Roo.bootstrap.Table,Roo.bootstrap.Component,{cls:false,align:false,bgcolor:false,border:false,cellpadding:false,cellspacing:false,frame:false,rules:false,sortable:false,summary:false,width:false,striped:false,bordered:false,hover:false,condensed:false,responsive:false,sm:false,cm:false,store:false,getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.Table.superclass.getAutoCreate.call(this));A={tag:'table',cls:'table',cn:[]};if(this.striped){A.cls+=' table-striped';}if(this.hover){A.cls+=' table-hover';}if(this.bordered){A.cls+=' table-bordered';}if(this.condensed){A.cls+=' table-condensed';}if(this.responsive){A.cls+=' table-responsive';}if(this.cls){A.cls+=' '+this.cls;}if(this.align){A.align=this.align;}if(this.bgcolor){A.bgcolor=this.bgcolor;}if(this.border){A.border=this.border;}if(this.cellpadding){A.cellpadding=this.cellpadding;}if(this.cellspacing){A.cellspacing=this.cellspacing;}if(this.frame){A.frame=this.frame;}if(this.rules){A.rules=this.rules;}if(this.sortable){A.sortable=this.sortable;}if(this.summary){A.summary=this.summary;}if(this.width){A.width=this.width;}if(this.store||this.cm){A.cn.push(this.renderHeader());A.cn.push(this.renderBody());A.cn.push(this.renderFooter());A.cls+=' TableGrid';}return A;},initEvents:function(){if(!this.store||!this.cm){return;} Roo.log('initEvents with ds!!!!');var A=this;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',A.sort,A);});this.store.on('load',this.onLoad,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.load();},sort:function(e,el){var A=Roo.get(el)if(!A.hasClass('sortable')){return;}var sort=A.attr('sort');var B='ASC';if(A.hasClass('glyphicon-arrow-up')){B='DESC';} this.store.sortInfo={field:sort,direction:B};this.store.load();},renderHeader:function(){var A={tag:'thead',cn:[]};var cm=this.cm;for(var i=0,B=cm.getColumnCount();i0){this.store.data.each(function(d){var C={tag:'tr',cn:[]};for(var i=0,D=cm.getColumnCount();i0){this.store.data.each(function(d){var D={tag:'tr',cn:[]};for(var i=0,E=cm.getColumnCount();i