StandMeetingManbar.js.svn-base 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * 此toolbar用于明细表grid
  3. */
  4. Ext.define('erp.view.oa.meeting.StandMeetingManbar',{
  5. extend: 'Ext.Toolbar',
  6. alias: 'widget.StandMeetingManbar',
  7. dock: 'bottom',
  8. requires: ['erp.view.core.button.AddDetail','erp.view.core.button.DeleteDetail','erp.view.core.button.Copy',
  9. 'erp.view.core.button.Paste','erp.view.core.button.Up','erp.view.core.button.Down',
  10. 'erp.view.core.button.UpExcel'],
  11. initComponent : function(){
  12. Ext.apply(this,{//default buttons
  13. items: [{
  14. xtype: 'tbtext',
  15. id: 'MeDrow'
  16. },'-',{
  17. xtype: 'erpAddDetailButton',
  18. id:'MeaddDetail'
  19. },'-',{
  20. xtype: 'erpDeleteDetailButton',
  21. id:'MedeleteDetail'
  22. },'-',{
  23. xtype: 'copydetail',
  24. id:'MecopyDetail'
  25. },'-',{
  26. xtype: 'pastedetail',
  27. id:'MepasteDetail'
  28. },'-',{
  29. xtype: 'updetail',
  30. id:'MeupDetail'
  31. },'-',{
  32. xtype: 'downdetail',
  33. id:'MedownDetail'
  34. },'-']
  35. });
  36. if(gridCondition == ""){//如果grid无数据,即录入界面,从数据库取配置的button
  37. var me = this;
  38. Ext.Ajax.request({
  39. url : basePath + "common/gridButton.action",
  40. params: {
  41. caller: caller
  42. },
  43. method : 'post',
  44. callback : function(options,success,response){
  45. var localJson = new Ext.decode(response.responseText);
  46. if(localJson.exceptionInfo){
  47. showError(localJson.exceptionInfo);
  48. }
  49. if(localJson.buttons){
  50. var buttons = Ext.decode(localJson.buttons);
  51. var index = 6;
  52. Ext.each(buttons, function(btn){
  53. me.insert(++index, btn);
  54. });
  55. //me.add(buttons);
  56. }
  57. }
  58. });
  59. }
  60. this.callParent(arguments);
  61. }
  62. });