Advertisement
chughgaurav

navigatingPanels.js

Apr 16th, 2012
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. Ext.define('MyApp.view.navigatingPanels',{
  2. extend: 'Ext.Panel',
  3. id: 'navigatingPanels',
  4. xtype: 'navigatingPanels',
  5. config:{
  6. iconCls:'user',
  7. title: 'Navigating Panels',
  8. layout: 'card',
  9. animation: {
  10. type: 'slide',
  11. direction: 'left'
  12. },
  13. defaults:{
  14. styleHtmlContent: 'true'
  15. },
  16. items: [
  17. {
  18. docked: 'top',
  19. xtype: 'toolbar',
  20. title: 'Registeration Form',
  21. items: [
  22. {
  23. text: 'Back',
  24. ui: 'back',
  25. align: 'centre',
  26. //back button to take the user back from form2 to form1
  27. handler: function() {
  28. Ext.getCmp('navigatingPanels').setActiveItem(form1);
  29. console.log(Ext.getCmp('navigatingPanels'));
  30.  
  31. }
  32. }
  33. ]
  34. },
  35. {
  36. xtype: 'fieldset',
  37. title: 'Form 0',
  38. items: [
  39. {
  40. xtype: 'textfield',
  41. label: 'Form 0',
  42. name: 'name',
  43. },
  44. {
  45. xtype:'button',
  46. text:'Save Data & move to form2',
  47. ui: 'confirm',
  48. //TODO add some action: to store data
  49. //save data & move to form2
  50. handler: function() {
  51. Ext.getCmp('navigatingPanels').setActiveItem(form2,{ type: 'slide', direction: 'right' });
  52. console.log("hello");
  53. }
  54. }
  55. ]
  56. }
  57. ]
  58. }
  59.  
  60. });
  61.  
  62.  
  63. var form1 = new Ext.Panel({
  64. scrollable: 'vertical',
  65. items:[
  66. {
  67. xtype: 'fieldset',
  68. title: 'Form 1',
  69. items: [
  70. {
  71. xtype: 'textfield',
  72. label: 'Name',
  73. name: 'name',
  74. },
  75. {
  76. xtype:'button',
  77. text:'Save Data & move to form2',
  78. ui: 'confirm',
  79. //TODO add some action: to store data
  80. //save data & move to form2
  81. handler: function() {
  82. Ext.getCmp('navigatingPanels').setActiveItem(form2,{ type: 'slide', direction: 'right' });
  83. console.log("Form1");
  84. }
  85. }
  86. ]
  87. }
  88. ]
  89. });
  90. var form2 =new Ext.Panel({
  91. scrollable: 'vertical',
  92. items:[
  93. {
  94. xtype: 'fieldset',
  95. title: 'Form 2',
  96. items: [
  97. {
  98. xtype: 'textareafield',
  99. label: 'Message',
  100. name: 'message'
  101. },
  102. {
  103. xtype:'button',
  104. text:'Submit Data',
  105. ui: 'confirm',
  106. //TODO add some action: to store data
  107. //action: 'Submit Data'
  108. }
  109. ]
  110. }
  111. ]
  112. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement