1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- Ext.define('uas.view.window.searchPlan.TreePanel', {
- extend: 'Ext.tree.Panel',
- xtype: 'searchplan-treepanel',
- cls:'x-tree-searchPlanTree',
- requires: [
- 'Ext.tree.plugin.TreeViewDragDrop',
- 'Ext.data.TreeStore'
- ],
- dataUrl:'/api/searchPlanTree',
- rootVisible:false,
- useArrows: true,
- // viewConfig: {
- // plugins: {
- // treeviewdragdrop: {
- // containerScroll: true
- // }
- // }
- // },
- tbar: {
- reference: 'tbar',
- items: [{
- text: '保存',
- }, {
- text: '另存为',
- }, {
- text: '重置',
- }, {
- text: '修改',
- }, {
- text: '删除',
- }]
- },
- initComponent: function () {
- var me = this;
- me.store = Ext.create('Ext.data.TreeStore', {
- root: {
- text : 'Root',
- id: 0,
- expanded: true
- },
- autoLoad:false,
- });
- me.callParent(arguments);
- me.setTree();
- },
- setTree:function(){
- const me = this;
- Ext.Ajax.request({
- url: me.dataUrl,
- params: '',
- method: 'GET',
- async:false,
- success: function(response, opts) {
- var _data = Ext.decode(response.responseText);
- if(_data&&_data.data){
- me.getStore().setRootNode({
- text: '筛选方案列表',
- id: '0',
- iconCls: 'x-fa fa-list',
- expanded: true,
- children: _data.data
- });
- }
- },
- failure: function(response, opts) {}
- });
- }
- });
|