Roo/bootstrap/Table.js
authorEdward <edward@roojs.com>
Thu, 10 Jul 2014 06:01:04 +0000 (14:01 +0800)
committerEdward <edward@roojs.com>
Thu, 10 Jul 2014 06:01:04 +0000 (14:01 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/Table.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 312c9b7..9c323cb 100644 (file)
@@ -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();
index 7fe0e94..e53dea1 100644 (file)
@@ -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();
index 92a526b..4b11526 100644 (file)
@@ -82,7 +82,7 @@ Roo.log('initEvents with ds!!!!');var A=this;Roo.each(this.el.select('thead th.s
 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();i<B;i++){var C=cm.config[i];var c={tag:'th',html:cm.getColumnHeader(i)};if(typeof(C.dataIndex)!='undefined'){c.sort=C.dataIndex;}if(typeof(C.sortable)!='undefined'&&C.sortable){c.cls='sortable';}
 A.cn.push(c)}return A;},renderBody:function(){var A={tag:'tbody',cn:[]};return A;},renderFooter:function(){var A={tag:'tfoot',cn:[]};return A;},onLoad:function(){Roo.log('ds onload');var A=this;var cm=this.cm;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.removeClass(['glyphicon','glyphicon-arrow-up','glyphicon-arrow-down']);if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='ASC'){e.addClass(['glyphicon','glyphicon-arrow-up']);}if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='DESC'){e.addClass(['glyphicon','glyphicon-arrow-down']);}});var B=this.el.select('tbody',true).first();var C=[];if(this.store.getCount()>0){this.store.data.each(function(d){var D={tag:'tr',cn:[]};for(var i=0,E=cm.getColumnCount();i<E;i++){var F=cm.getRenderer(i);var G=cm.config[i];var H='';var id=Roo.id();if(typeof(F)!=='undefined'){H=F(d.data[cm.getDataIndex(i)],false,d);}if(typeof(H)==='object'){C.push({id:id,cfg:H})}var td={tag:'td',id:id,html:(typeof(H)==='object')?'':H};if(typeof(G.width)!='undefined'){td.width=G.width;}
 D.cn.push(td);}
-B.createChild(D);});}if(C.length){var A=this;Roo.each(C,function(r){A.renderColumn(r);})}},onBeforeLoad:function(){Roo.log('ds onBeforeLoad');},clear:function(){this.el.select('tbody',true).first().dom.innerHTML='';},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.bootstrap.Table.RowSelectionModel();}return this.selModel;},renderColumn:function(r){var A=this;r.cfg.render(Roo.get(r.id));if(r.cfg.cn){Roo.each(r.cfg.cn,function(c){var B={id:r.id,cfg:c}
+B.createChild(D);});}if(C.length){var A=this;Roo.each(C,function(r){A.renderColumn(r);})}},onBeforeLoad:function(){Roo.log('ds onBeforeLoad');this.clear();},clear:function(){this.el.select('tbody',true).first().dom.innerHTML='';},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.bootstrap.Table.RowSelectionModel();}return this.selModel;},renderColumn:function(r){var A=this;r.cfg.render(Roo.get(r.id));if(r.cfg.cn){Roo.each(r.cfg.cn,function(c){var B={id:r.id,cfg:c}
 A.renderColumn(B);})}}});
 //Roo/bootstrap/TableCell.js
 Roo.bootstrap.TableCell=function(A){Roo.bootstrap.TableCell.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TableCell,Roo.bootstrap.Component,{html:false,cls:false,tag:false,abbr:false,align:false,axis:false,bgcolor:false,charoff:false,colspan:false,headers:false,height:false,nowrap:false,rowspan:false,scope:false,valign:false,width:false,getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.TableCell.superclass.getAutoCreate.call(this));A={tag:'td'};if(this.tag){A.tag=this.tag;}if(this.html){A.html=this.html}if(this.cls){A.cls=this.cls}if(this.abbr){A.abbr=this.abbr}if(this.align){A.align=this.align}if(this.axis){A.axis=this.axis}if(this.bgcolor){A.bgcolor=this.bgcolor}if(this.charoff){A.charoff=this.charoff}if(this.colspan){A.colspan=this.colspan}if(this.headers){A.headers=this.headers}if(this.height){A.height=this.height}if(this.nowrap){A.nowrap=this.nowrap}if(this.rowspan){A.rowspan=this.rowspan}if(this.scope){A.scope=this.scope}if(this.valign){A.valign=this.valign}if(this.width){A.width=this.width}return A;}});