X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/pkgs/pkg-toolbars.js diff --git a/pkgs/pkg-toolbars.js b/pkgs/pkg-toolbars.js deleted file mode 100644 index 43dccab7..00000000 --- a/pkgs/pkg-toolbars.js +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Ext JS Library 3.0.0 - * Copyright(c) 2006-2009 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license - */ -Ext.layout.ToolbarLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,triggerWidth:18,lastOverflow:false,noItemsMenuText:'
(None)
',onLayout:function(d,f){if(!this.leftTr){f.addClass("x-toolbar-layout-ct");f.insertHtml("beforeEnd",'
');this.leftTr=f.child("tr.x-toolbar-left-row",true);this.rightTr=f.child("tr.x-toolbar-right-row",true);this.extrasTr=f.child("tr.x-toolbar-extras-row",true)}var g=this.leftTr;var k=0;var h=d.items.items;for(var b=0,e=h.length,j;b=0&&(d=e[a]);a--){if(!d.firstChild){b.removeChild(d)}}},insertCell:function(e,a,d){var b=document.createElement("td");b.className="x-toolbar-cell";a.insertBefore(b,a.childNodes[d]||null);return b},hideItem:function(b){var a=(this.hiddens=this.hiddens||[]);a.push(b);b.xtbHidden=true;b.xtbWidth=b.getDomPositionEl().dom.parentNode.offsetWidth;b.hide()},unhideItem:function(a){a.show();a.xtbHidden=false;this.hiddens.remove(a);if(this.hiddens.length<1){delete this.hiddens}},getItemWidth:function(a){return a.hidden?(a.xtbWidth||0):a.getDomPositionEl().dom.parentNode.offsetWidth},fitToSize:function(m){if(this.container.enableOverflow===false){return}var l=m.dom.clientWidth;var b=this.lastWidth||0;this.lastWidth=l;var d=m.dom.firstChild.offsetWidth;var k=l-this.triggerWidth;var j=-1;if(d>l||(this.hiddens&&l>=b)){var e,g=this.container.items.items,f=g.length,h;var a=0;for(e=0;ek){if(!h.xtbHidden){this.hideItem(h)}}else{if(h.xtbHidden){this.unhideItem(h)}}}}}if(this.hiddens){this.initMore();if(!this.lastOverflow){this.container.fireEvent("overflowchange",this.container,true);this.lastOverflow=true}}else{if(this.more){this.clearMenu();this.more.destroy();delete this.more;if(this.lastOverflow){this.container.fireEvent("overflowchange",this.container,false);this.lastOverflow=false}}}},createMenuConfig:function(e,b){var a=Ext.apply({},e.initialConfig),d=e.toggleGroup;Ext.apply(a,{text:e.overflowText||e.text,iconCls:e.iconCls,icon:e.icon,itemId:e.itemId,disabled:e.disabled,handler:e.handler,scope:e.scope,menu:e.menu,hideOnClick:b});if(d||e.enableToggle){Ext.apply(a,{group:d,checked:e.pressed,listeners:{checkchange:function(f,c){e.toggle(c)}}})}delete a.xtype;delete a.id;return a},addComponentToMenu:function(a,b){if(b instanceof Ext.Toolbar.Separator){a.add("-")}else{if(Ext.isFunction(b.isXType)){if(b.isXType("splitbutton")){a.add(this.createMenuConfig(b,true))}else{if(b.isXType("button")){a.add(this.createMenuConfig(b,!b.menu))}else{if(b.isXType("buttongroup")){b.items.each(function(c){this.addComponentToMenu(a,c)},this)}}}}}},clearMenu:function(){var a=this.moreMenu;if(a&&a.items){this.moreMenu.items.each(function(b){delete b.menu})}},beforeMoreShow:function(b){var f=this.container.items.items,a=f.length,j,g,d=function(h,c){return h.isXType("buttongroup")&&!(c instanceof Ext.Toolbar.Separator)};this.clearMenu();b.removeAll();for(var e=0;e"){b=new a.Fill()}else{b=new a.TextItem(b)}}}this.applyDefaults(b)}else{if(b.isFormField||b.render){b=this.constructItem(b)}else{if(b.tag){b=new a.Item({autoEl:b})}else{if(b.tagName){b=new a.Item({el:b})}else{if(Ext.isObject(b)){b=b.xtype?this.constructItem(b):this.constructButton(b)}}}}}return b},applyDefaults:function(e){if(!Ext.isString(e)){e=Ext.Toolbar.superclass.applyDefaults.call(this,e);var b=this.internalDefaults;if(e.events){Ext.applyIf(e.initialConfig,b);Ext.apply(e,b)}else{Ext.applyIf(e,b)}}return e},constructItem:function(c,b){return Ext.create(c,b||this.defaultType)},addSeparator:function(){return this.add(new a.Separator())},addSpacer:function(){return this.add(new a.Spacer())},addFill:function(){this.add(new a.Fill())},addElement:function(b){return this.addItem(new a.Item({el:b}))},addItem:function(b){return Ext.Toolbar.superclass.add.apply(this,arguments)},addButton:function(c){if(Ext.isArray(c)){var e=[];for(var d=0,b=c.length;d");this.items.push(this.displayItem=new a.TextItem({}))}Ext.PagingToolbar.superclass.initComponent.call(this);this.addEvents("change","beforechange");this.on("afterlayout",this.onFirstLayout,this,{single:true});this.cursor=0;this.bindStore(this.store)},onFirstLayout:function(){if(this.dsLoaded){this.onLoad.apply(this,this.dsLoaded)}},updateInfo:function(){if(this.displayItem){var b=this.store.getCount();var c=b==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+b,this.store.getTotalCount());this.displayItem.setText(c)}},onLoad:function(b,e,i){if(!this.rendered){this.dsLoaded=[b,e,i];return}var f=this.getParams();this.cursor=(i.params&&i.params[f.start])?i.params[f.start]:0;var h=this.getPageData(),c=h.activePage,g=h.pages;this.afterTextItem.setText(String.format(this.afterPageText,h.pages));this.inputItem.setValue(c);this.first.setDisabled(c==1);this.prev.setDisabled(c==1);this.next.setDisabled(c==g);this.last.setDisabled(c==g);this.refresh.enable();this.updateInfo();this.fireEvent("change",this,h)},getPageData:function(){var b=this.store.getTotalCount();return{total:b,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:b=1&f<=i.pages){h.setValue(f)}}}}}},getParams:function(){return this.paramNames||this.store.paramNames},beforeLoad:function(){if(this.rendered&&this.refresh){this.refresh.disable()}},doLoad:function(d){var c={},b=this.getParams();c[b.start]=d;c[b.limit]=this.pageSize;if(this.fireEvent("beforechange",this,c)!==false){this.store.load({params:c})}},moveFirst:function(){this.doLoad(0)},movePrevious:function(){this.doLoad(Math.max(0,this.cursor-this.pageSize))},moveNext:function(){this.doLoad(this.cursor+this.pageSize)},moveLast:function(){var c=this.store.getTotalCount(),b=c%this.pageSize;this.doLoad(b?(c-b):c-this.pageSize)},refresh:function(){this.doLoad(this.cursor)},bindStore:function(c,d){var b;if(!d&&this.store){this.store.un("beforeload",this.beforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.onLoadError,this);if(c!==this.store&&this.store.autoDestroy){this.store.destroy()}}if(c){c=Ext.StoreMgr.lookup(c);c.on({scope:this,beforeload:this.beforeLoad,load:this.onLoad,exception:this.onLoadError});b=c.getCount()>0}this.store=c;if(b){this.onLoad(c,null,{})}},unbind:function(b){this.bindStore(null)},bind:function(b){this.bindStore(b)},onDestroy:function(){this.bindStore(null);Ext.PagingToolbar.superclass.onDestroy.call(this)}})})();Ext.reg("paging",Ext.PagingToolbar); \ No newline at end of file