roojs-ui.js
authorEdward <edward@roojs.com>
Tue, 19 May 2015 10:33:08 +0000 (18:33 +0800)
committerEdward <edward@roojs.com>
Tue, 19 May 2015 10:33:08 +0000 (18:33 +0800)
roojs-ui-debug.js
roojs-all.js
roojs-debug.js

roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index 556a19f..ca19185 100644 (file)
@@ -586,7 +586,8 @@ this.el.update('<div class="x-toolbar x-small-editor"><table cellspacing="0"><tr
 Roo.Element.uncache(this.el,this.tr);}};Roo.Toolbar.Item=function(el){var A={};if(typeof(el.xtype)!='undefined'){A=el;el=A.el;}
 this.el=Roo.getDom(el);this.id=Roo.id(this.el);this.hidden=false;this.addEvents({'render':true});Roo.Toolbar.Item.superclass.constructor.call(this,A);};Roo.extend(Roo.Toolbar.Item,Roo.util.Observable,{getEl:function(){return this.el;},render:function(td){this.td=td;td.appendChild(this.el);this.fireEvent('render',this);},destroy:function(){this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";},setVisible:function(A){if(A){this.show();}else {this.hide();}},focus:function(){Roo.fly(this.el).focus();},disable:function(){Roo.fly(this.td).addClass("x-item-disabled");this.disabled=true;this.el.disabled=true;},enable:function(){Roo.fly(this.td).removeClass("x-item-disabled");this.disabled=false;this.el.disabled=false;}});Roo.Toolbar.Separator=function(A){var s=document.createElement("span");s.className="ytb-sep";if(A){A.el=s;}
 Roo.Toolbar.Separator.superclass.constructor.call(this,A||s);};Roo.extend(Roo.Toolbar.Separator,Roo.Toolbar.Item,{enable:Roo.emptyFn,disable:Roo.emptyFn,focus:Roo.emptyFn});Roo.Toolbar.Spacer=function(A){var s=document.createElement("div");s.className="ytb-spacer";if(A){A.el=s;}
-Roo.Toolbar.Spacer.superclass.constructor.call(this,A||s);};Roo.extend(Roo.Toolbar.Spacer,Roo.Toolbar.Item,{enable:Roo.emptyFn,disable:Roo.emptyFn,focus:Roo.emptyFn});Roo.Toolbar.Fill=Roo.extend(Roo.Toolbar.Spacer,{render:function(td){td.style.width='100%';Roo.Toolbar.Fill.superclass.render.call(this,td);}});Roo.Toolbar.TextItem=function(A){if(typeof(A)=='object'){text=A.text;}var s=document.createElement("span");s.className="ytb-text";s.innerHTML=text;Roo.Toolbar.TextItem.superclass.constructor.call(this,A||s);};Roo.extend(Roo.Toolbar.TextItem,Roo.Toolbar.Item,{enable:Roo.emptyFn,disable:Roo.emptyFn,focus:Roo.emptyFn});Roo.Toolbar.Button=function(A){Roo.Toolbar.Button.superclass.constructor.call(this,null,A);};Roo.extend(Roo.Toolbar.Button,Roo.Button,{render:function(td){this.td=td;Roo.Toolbar.Button.superclass.render.call(this,td);},destroy:function(){Roo.Toolbar.Button.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";},disable:function(){Roo.fly(this.td).addClass("x-item-disabled");this.disabled=true;},enable:function(){Roo.fly(this.td).removeClass("x-item-disabled");this.disabled=false;}});Roo.ToolbarButton=Roo.Toolbar.Button;Roo.Toolbar.SplitButton=function(A){Roo.Toolbar.SplitButton.superclass.constructor.call(this,null,A);};Roo.extend(Roo.Toolbar.SplitButton,Roo.SplitButton,{render:function(td){this.td=td;Roo.Toolbar.SplitButton.superclass.render.call(this,td);},destroy:function(){Roo.Toolbar.SplitButton.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";}});Roo.Toolbar.MenuButton=Roo.Toolbar.SplitButton;
+Roo.Toolbar.Spacer.superclass.constructor.call(this,A||s);};Roo.extend(Roo.Toolbar.Spacer,Roo.Toolbar.Item,{enable:Roo.emptyFn,disable:Roo.emptyFn,focus:Roo.emptyFn});Roo.Toolbar.Fill=Roo.extend(Roo.Toolbar.Spacer,{render:function(td){td.style.width='100%';Roo.Toolbar.Fill.superclass.render.call(this,td);}});Roo.Toolbar.TextItem=function(A){var B="";if(typeof(A)=='object'){B=A.text;}else {A=null;}var s=document.createElement("span");s.className="ytb-text";s.innerHTML=B;if(A){A.el=s;}
+Roo.Toolbar.TextItem.superclass.constructor.call(this,A||s);};Roo.extend(Roo.Toolbar.TextItem,Roo.Toolbar.Item,{enable:Roo.emptyFn,disable:Roo.emptyFn,focus:Roo.emptyFn});Roo.Toolbar.Button=function(A){Roo.Toolbar.Button.superclass.constructor.call(this,null,A);};Roo.extend(Roo.Toolbar.Button,Roo.Button,{render:function(td){this.td=td;Roo.Toolbar.Button.superclass.render.call(this,td);},destroy:function(){Roo.Toolbar.Button.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";},disable:function(){Roo.fly(this.td).addClass("x-item-disabled");this.disabled=true;},enable:function(){Roo.fly(this.td).removeClass("x-item-disabled");this.disabled=false;}});Roo.ToolbarButton=Roo.Toolbar.Button;Roo.Toolbar.SplitButton=function(A){Roo.Toolbar.SplitButton.superclass.constructor.call(this,null,A);};Roo.extend(Roo.Toolbar.SplitButton,Roo.SplitButton,{render:function(td){this.td=td;Roo.Toolbar.SplitButton.superclass.render.call(this,td);},destroy:function(){Roo.Toolbar.SplitButton.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";}});Roo.Toolbar.MenuButton=Roo.Toolbar.SplitButton;
 //Roo/PagingToolbar.js
 Roo.PagingToolbar=function(el,ds,A){if(typeof(el)=='object'&&el.xtype){A=el;ds=el.dataSource;el=A.container;}var B=[];if(A.items){B=A.items;A.items=[];}
 Roo.PagingToolbar.superclass.constructor.call(this,el,null,A);this.ds=ds;this.cursor=0;this.renderButtons(this.el);this.bind(ds);Roo.each(B,function(e){this.add(Roo.factory(e));},this);};Roo.extend(Roo.PagingToolbar,Roo.Toolbar,{pageSize:20,displayMsg:'Displaying {0} - {1} of {2}',emptyMsg:'No data to display',beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",renderButtons:function(el){Roo.PagingToolbar.superclass.render.call(this,el);this.first=this.addButton({tooltip:this.firstText,cls:"x-btn-icon x-grid-page-first",disabled:true,handler:this.onClick.createDelegate(this,["first"])});this.prev=this.addButton({tooltip:this.prevText,cls:"x-btn-icon x-grid-page-prev",disabled:true,handler:this.onClick.createDelegate(this,["prev"])});this.add(this.beforePageText);this.field=Roo.get(this.addDom({tag:"input",type:"text",size:"3",value:"1",cls:"x-grid-page-number"}).el);this.field.on("keydown",this.onPagingKeydown,this);this.field.on("focus",function(){this.dom.select();});this.afterTextEl=this.addText(String.format(this.afterPageText,1));this.field.setHeight(18);this.next=this.addButton({tooltip:this.nextText,cls:"x-btn-icon x-grid-page-next",disabled:true,handler:this.onClick.createDelegate(this,["next"])});this.last=this.addButton({tooltip:this.lastText,cls:"x-btn-icon x-grid-page-last",disabled:true,handler:this.onClick.createDelegate(this,["last"])});this.loading=this.addButton({tooltip:this.refreshText,cls:"x-btn-icon x-grid-loading",handler:this.onClick.createDelegate(this,["refresh"])});if(this.displayInfo){this.displayEl=Roo.fly(this.el.dom.firstChild).createChild({cls:'x-paging-info'});}},updateInfo:function(){if(this.displayEl){var A=this.ds.getCount();var B=A==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+A,this.ds.getTotalCount());this.displayEl.update(B);}},onLoad:function(ds,r,o){this.cursor=o.params?o.params.start:0;var d=this.getPageData(),ap=d.activePage,ps=d.pages;this.afterTextEl.el.innerHTML=String.format(this.afterPageText,d.pages);this.field.dom.value=ap;this.first.setDisabled(ap==1);this.prev.setDisabled(ap==1);this.next.setDisabled(ap==ps);this.last.setDisabled(ap==ps);this.loading.enable();this.updateInfo();},getPageData:function(){var A=this.ds.getTotalCount();return {total:A,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:A<this.pageSize?1:Math.ceil(A/this.pageSize)};},onLoadError:function(){this.loading.enable();},onPagingKeydown:function(e){var k=e.getKey();var d=this.getPageData();if(k==e.RETURN ){var v=this.field.dom.value,A;if(!v||isNaN(A=parseInt(v,10))){this.field.dom.value=d.activePage;return;}
index b66677c..fa41b1d 100644 (file)
@@ -28688,12 +28688,20 @@ Roo.Toolbar.Fill = Roo.extend(Roo.Toolbar.Spacer, {
  * @param {String} text
  */
 Roo.Toolbar.TextItem = function(cfg){
+    var text ="";
     if (typeof(cfg) == 'object') {
         text = cfg.text;
+    } else {
+        cfg = null;
     }
+     
     var s = document.createElement("span");
     s.className = "ytb-text";
     s.innerHTML = text;
+    if (cfg) {
+        cfg.el  = s;
+    }
+    
     Roo.Toolbar.TextItem.superclass.constructor.call(this, cfg ||  s);
 };
 Roo.extend(Roo.Toolbar.TextItem, Roo.Toolbar.Item, {
index fb2261d..71f056e 100644 (file)
@@ -12258,12 +12258,20 @@ Roo.Toolbar.Fill = Roo.extend(Roo.Toolbar.Spacer, {
  * @param {String} text
  */
 Roo.Toolbar.TextItem = function(cfg){
+    var text ="";
     if (typeof(cfg) == 'object') {
         text = cfg.text;
+    } else {
+        cfg = null;
     }
+     
     var s = document.createElement("span");
     s.className = "ytb-text";
     s.innerHTML = text;
+    if (cfg) {
+        cfg.el  = s;
+    }
+    
     Roo.Toolbar.TextItem.superclass.constructor.call(this, cfg ||  s);
 };
 Roo.extend(Roo.Toolbar.TextItem, Roo.Toolbar.Item, {
index 557195a..03414d7 100644 (file)
@@ -251,7 +251,8 @@ this.el.update('<div class="x-toolbar x-small-editor"><table cellspacing="0"><tr
 Roo.Element.uncache(this.el,this.tr);}};Roo.Toolbar.Item=function(el){var A={};if(typeof(el.xtype)!='undefined'){A=el;el=A.el;}
 this.el=Roo.getDom(el);this.id=Roo.id(this.el);this.hidden=false;this.addEvents({'render':true});Roo.Toolbar.Item.superclass.constructor.call(this,A);};Roo.extend(Roo.Toolbar.Item,Roo.util.Observable,{getEl:function(){return this.el;},render:function(td){this.td=td;td.appendChild(this.el);this.fireEvent('render',this);},destroy:function(){this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";},setVisible:function(A){if(A){this.show();}else {this.hide();}},focus:function(){Roo.fly(this.el).focus();},disable:function(){Roo.fly(this.td).addClass("x-item-disabled");this.disabled=true;this.el.disabled=true;},enable:function(){Roo.fly(this.td).removeClass("x-item-disabled");this.disabled=false;this.el.disabled=false;}});Roo.Toolbar.Separator=function(A){var s=document.createElement("span");s.className="ytb-sep";if(A){A.el=s;}
 Roo.Toolbar.Separator.superclass.constructor.call(this,A||s);};Roo.extend(Roo.Toolbar.Separator,Roo.Toolbar.Item,{enable:Roo.emptyFn,disable:Roo.emptyFn,focus:Roo.emptyFn});Roo.Toolbar.Spacer=function(A){var s=document.createElement("div");s.className="ytb-spacer";if(A){A.el=s;}
-Roo.Toolbar.Spacer.superclass.constructor.call(this,A||s);};Roo.extend(Roo.Toolbar.Spacer,Roo.Toolbar.Item,{enable:Roo.emptyFn,disable:Roo.emptyFn,focus:Roo.emptyFn});Roo.Toolbar.Fill=Roo.extend(Roo.Toolbar.Spacer,{render:function(td){td.style.width='100%';Roo.Toolbar.Fill.superclass.render.call(this,td);}});Roo.Toolbar.TextItem=function(A){if(typeof(A)=='object'){text=A.text;}var s=document.createElement("span");s.className="ytb-text";s.innerHTML=text;Roo.Toolbar.TextItem.superclass.constructor.call(this,A||s);};Roo.extend(Roo.Toolbar.TextItem,Roo.Toolbar.Item,{enable:Roo.emptyFn,disable:Roo.emptyFn,focus:Roo.emptyFn});Roo.Toolbar.Button=function(A){Roo.Toolbar.Button.superclass.constructor.call(this,null,A);};Roo.extend(Roo.Toolbar.Button,Roo.Button,{render:function(td){this.td=td;Roo.Toolbar.Button.superclass.render.call(this,td);},destroy:function(){Roo.Toolbar.Button.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";},disable:function(){Roo.fly(this.td).addClass("x-item-disabled");this.disabled=true;},enable:function(){Roo.fly(this.td).removeClass("x-item-disabled");this.disabled=false;}});Roo.ToolbarButton=Roo.Toolbar.Button;Roo.Toolbar.SplitButton=function(A){Roo.Toolbar.SplitButton.superclass.constructor.call(this,null,A);};Roo.extend(Roo.Toolbar.SplitButton,Roo.SplitButton,{render:function(td){this.td=td;Roo.Toolbar.SplitButton.superclass.render.call(this,td);},destroy:function(){Roo.Toolbar.SplitButton.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";}});Roo.Toolbar.MenuButton=Roo.Toolbar.SplitButton;
+Roo.Toolbar.Spacer.superclass.constructor.call(this,A||s);};Roo.extend(Roo.Toolbar.Spacer,Roo.Toolbar.Item,{enable:Roo.emptyFn,disable:Roo.emptyFn,focus:Roo.emptyFn});Roo.Toolbar.Fill=Roo.extend(Roo.Toolbar.Spacer,{render:function(td){td.style.width='100%';Roo.Toolbar.Fill.superclass.render.call(this,td);}});Roo.Toolbar.TextItem=function(A){var B="";if(typeof(A)=='object'){B=A.text;}else {A=null;}var s=document.createElement("span");s.className="ytb-text";s.innerHTML=B;if(A){A.el=s;}
+Roo.Toolbar.TextItem.superclass.constructor.call(this,A||s);};Roo.extend(Roo.Toolbar.TextItem,Roo.Toolbar.Item,{enable:Roo.emptyFn,disable:Roo.emptyFn,focus:Roo.emptyFn});Roo.Toolbar.Button=function(A){Roo.Toolbar.Button.superclass.constructor.call(this,null,A);};Roo.extend(Roo.Toolbar.Button,Roo.Button,{render:function(td){this.td=td;Roo.Toolbar.Button.superclass.render.call(this,td);},destroy:function(){Roo.Toolbar.Button.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";},disable:function(){Roo.fly(this.td).addClass("x-item-disabled");this.disabled=true;},enable:function(){Roo.fly(this.td).removeClass("x-item-disabled");this.disabled=false;}});Roo.ToolbarButton=Roo.Toolbar.Button;Roo.Toolbar.SplitButton=function(A){Roo.Toolbar.SplitButton.superclass.constructor.call(this,null,A);};Roo.extend(Roo.Toolbar.SplitButton,Roo.SplitButton,{render:function(td){this.td=td;Roo.Toolbar.SplitButton.superclass.render.call(this,td);},destroy:function(){Roo.Toolbar.SplitButton.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";}});Roo.Toolbar.MenuButton=Roo.Toolbar.SplitButton;
 //Roo/PagingToolbar.js
 Roo.PagingToolbar=function(el,ds,A){if(typeof(el)=='object'&&el.xtype){A=el;ds=el.dataSource;el=A.container;}var B=[];if(A.items){B=A.items;A.items=[];}
 Roo.PagingToolbar.superclass.constructor.call(this,el,null,A);this.ds=ds;this.cursor=0;this.renderButtons(this.el);this.bind(ds);Roo.each(B,function(e){this.add(Roo.factory(e));},this);};Roo.extend(Roo.PagingToolbar,Roo.Toolbar,{pageSize:20,displayMsg:'Displaying {0} - {1} of {2}',emptyMsg:'No data to display',beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",renderButtons:function(el){Roo.PagingToolbar.superclass.render.call(this,el);this.first=this.addButton({tooltip:this.firstText,cls:"x-btn-icon x-grid-page-first",disabled:true,handler:this.onClick.createDelegate(this,["first"])});this.prev=this.addButton({tooltip:this.prevText,cls:"x-btn-icon x-grid-page-prev",disabled:true,handler:this.onClick.createDelegate(this,["prev"])});this.add(this.beforePageText);this.field=Roo.get(this.addDom({tag:"input",type:"text",size:"3",value:"1",cls:"x-grid-page-number"}).el);this.field.on("keydown",this.onPagingKeydown,this);this.field.on("focus",function(){this.dom.select();});this.afterTextEl=this.addText(String.format(this.afterPageText,1));this.field.setHeight(18);this.next=this.addButton({tooltip:this.nextText,cls:"x-btn-icon x-grid-page-next",disabled:true,handler:this.onClick.createDelegate(this,["next"])});this.last=this.addButton({tooltip:this.lastText,cls:"x-btn-icon x-grid-page-last",disabled:true,handler:this.onClick.createDelegate(this,["last"])});this.loading=this.addButton({tooltip:this.refreshText,cls:"x-btn-icon x-grid-loading",handler:this.onClick.createDelegate(this,["refresh"])});if(this.displayInfo){this.displayEl=Roo.fly(this.el.dom.firstChild).createChild({cls:'x-paging-info'});}},updateInfo:function(){if(this.displayEl){var A=this.ds.getCount();var B=A==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+A,this.ds.getTotalCount());this.displayEl.update(B);}},onLoad:function(ds,r,o){this.cursor=o.params?o.params.start:0;var d=this.getPageData(),ap=d.activePage,ps=d.pages;this.afterTextEl.el.innerHTML=String.format(this.afterPageText,d.pages);this.field.dom.value=ap;this.first.setDisabled(ap==1);this.prev.setDisabled(ap==1);this.next.setDisabled(ap==ps);this.last.setDisabled(ap==ps);this.loading.enable();this.updateInfo();},getPageData:function(){var A=this.ds.getTotalCount();return {total:A,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:A<this.pageSize?1:Math.ceil(A/this.pageSize)};},onLoadError:function(){this.loading.enable();},onPagingKeydown:function(e){var k=e.getKey();var d=this.getPageData();if(k==e.RETURN ){var v=this.field.dom.value,A;if(!v||isNaN(A=parseInt(v,10))){this.field.dom.value=d.activePage;return;}