From: Edward Date: Thu, 10 Jul 2014 04:36:31 +0000 (+0800) Subject: Roo/bootstrap/Table.js X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=5a16d4978668804cb2b50c7b497caf6c7b541143;p=roojs1 Roo/bootstrap/Table.js roojs-bootstrap.js roojs-bootstrap-debug.js --- diff --git a/Roo/bootstrap/Table.js b/Roo/bootstrap/Table.js index 23ab0220f5..42473b0742 100644 --- a/Roo/bootstrap/Table.js +++ b/Roo/bootstrap/Table.js @@ -211,10 +211,9 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, { for(var i = 0, len = cm.getColumnCount(); i < len; i++){ var index = cm.getDataIndex(i); - Roo.log('header!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'); - Roo.log(i + " : " + index); header.cn.push({ tag: 'th', + sort: index, html: cm.getColumnHeader(i) }) } diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index c5c56b92ce..38b2dfb5d4 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -2974,10 +2974,9 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, { for(var i = 0, len = cm.getColumnCount(); i < len; i++){ var index = cm.getDataIndex(i); - Roo.log('header!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'); - Roo.log(i + " : " + index); header.cn.push({ tag: 'th', + sort: index, html: cm.getColumnHeader(i) }) } diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index df57c4c9c8..a7ceb4f07a 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -78,7 +78,7 @@ this.fireEvent('click',this,e);}}); Roo.bootstrap.Slider=function(A){Roo.bootstrap.Slider.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Slider,Roo.bootstrap.Component,{getAutoCreate:function(){var A={tag:'div',cls:'slider slider-sample1 vertical-handler ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all',cn:[{tag:'a',cls:'ui-slider-handle ui-state-default ui-corner-all'}]};return A;}}); //Roo/bootstrap/Table.js 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!!!!');this.store.on('load',this.onLoad,this);this.store.on('beforeload',this.onBeforeLoad,this);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 D={tag:'tr',cn:[]};for(var i=0,E=cm.getColumnCount();i0){this.store.data.each(function(d){var D={tag:'tr',cn:[]};for(var i=0,E=cm.getColumnCount();i