SysNavigation.js.svn-base 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Ext.define('erp.view.ma.SysNavigation',{
  2. extend: 'Ext.Viewport',
  3. layout: 'anchor',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. xtype: 'erpSysTreeGrid',
  10. anchor: '100% 100%'
  11. },{
  12. xtype: 'grid',
  13. anchor: '100% 25%',
  14. plugins: Ext.create('Ext.grid.plugin.CellEditing', {
  15. clicksToEdit: 1
  16. }),
  17. store: Ext.create('Ext.data.Store', {
  18. fields: ['sn_id', 'sn_displayname', {name: 'sn_detno', type: 'int'}]
  19. }),
  20. columnLines: true,
  21. columns: [{
  22. hidden: true,
  23. dataIndex: 'sn_id'
  24. },{
  25. flex: 1,
  26. text: '描述',
  27. cls: 'x-grid-header-1',
  28. dataIndex: 'sn_displayname',
  29. editor: {
  30. xtype: 'textfield'
  31. },
  32. align: 'center',
  33. renderer: function(val, meta, record, x, y, store, view){
  34. var tree = view.ownerCt.ownerCt.down('erpSysTreeGrid'),
  35. node = tree.store.getNodeById(record.data.sn_id);
  36. if(node) {
  37. node.set('text', val);
  38. }
  39. return val;
  40. }
  41. },{
  42. flex: 0.3,
  43. text: '序号',
  44. cls: 'x-grid-header-1',
  45. dataIndex: 'sn_detno',
  46. align: 'center',
  47. editor: {
  48. xtype: 'numberfield',
  49. hideTrigger: true
  50. }
  51. }]
  52. }]
  53. });
  54. me.callParent(arguments);
  55. }
  56. });