123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- Ext.define('erp.view.ma.PDAPower', {
- extend : 'Ext.Viewport',
- layout : 'border',
- hideBorders : true,
- initComponent : function() {
- var me = this;
- Ext.apply(me, {
- items : [ {
- region : 'west',
- width : '24%',
- height : '100%',
- xtype : 'treepanel',
- singleExpand: true,
- id : 'powertree',
- rootVisible : false,
- useArrows : true,
- enableDD : false,
- split: true,
- containerScroll : true,
- collapsible : true,
- tbar:Ext.create('Ext.Toolbar',{
- items: [{
- width:215,
- xtype: 'searchfield',
- id: 'searchField',
- isPDA:true
- }, '->',{
- iconCls: 'tree-back',
- cls: 'x-btn-tb',
- width: 16,
- tooltip: $I18N.common.main.treeBack,
- hidden: false,
- handler: function(){
- Ext.getCmp('powertree').getTreeRootNode(0);
- Ext.getCmp('searchField').setValue(null);
- }
- },'->']}),
- getTreeRootNode: function(parentId){
- Ext.Ajax.request({//拿到tree数据
- url : basePath + 'ma/PDAlazyTree.action',
- params: {
- parentId: parentId,
- condition:'sn_limit=1'
- },
- callback : function(options,success,response){
- var res = new Ext.decode(response.responseText);
- if(res.tree){
- Ext.getCmp('powertree').store.setRootNode({
- text: 'root',
- id: 'root',
- expanded: true,
- children: res.tree
- });
- } else if(res.exceptionInfo){
- showError(res.exceptionInfo);
- }
- }
- });
- },
- store : Ext.create('Ext.data.TreeStore', {
- root : {
- text : 'root',
- id : 'root',
- expanded : true
- }
- })
- }, {
- region : 'center',
- height : '100%',
- xtype : 'grouppower'
- } ]
- });
- me.callParent(arguments);
- }
- });
|