Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. /**
  2. *
  3. */
  4.  
  5. Ext.ns('AppMain', 'App.grids');
  6.  
  7. App.grids.ProductInventory = Ext.extend(Ext.grid.GridPanel, {
  8. border: false,
  9. initComponent : function() {
  10. Ext.apply(this,{
  11. store: new Ext.data.SimpleStore({
  12. fields: [
  13. 'productSku',
  14. 'price',
  15. {name: 'expires', type: 'date', dateFormat: 'm-d-Y'}
  16. ],
  17. data: [
  18. ['A0015', 101.25, '09-01-2007'],
  19. ['C0084', 29.01, '09-02-2007'],
  20. ['H0016', 83.81, '09-05-2007']
  21. ]
  22. }),
  23. columns: [{
  24. dataIndex: 'productSku',
  25. header: 'Product SKU'
  26. },{
  27. dataIndex: 'price',
  28. header: 'Price',
  29. renderer: Ext.util.Format.usMoney
  30. },{
  31. dataIndex: 'expires',
  32. header: 'Expires',
  33. renderer: Ext.util.Format.dateRenderer('m/d/Y')
  34. }]
  35. });
  36. App.grids.ProductInventory.superclass.initComponent.call(this);
  37. }
  38. });
  39.  
  40. Ext.reg('productinventory', App.grids.ProductInventory);
  41.  
  42. AppMain = function(){
  43. return {
  44. init: function(){
  45. new Ext.Viewport({
  46. layout: 'border',
  47. items:[{
  48. region: 'west',
  49. title: 'Categories',
  50. width: 200,
  51. split: true,
  52. collapsible: true
  53. },{
  54. xtype: 'tabpanel',
  55. region: 'center',
  56. title: 'content',
  57. activeTab: 0,
  58. items: [{
  59. xtype: 'productinventory',
  60. title: 'Product Inventory'
  61. },{
  62. title: 'New Product'
  63. }]
  64. },{
  65. reagion: 'south',
  66. title: 'South',
  67. height: 100,
  68. split: true,
  69. collapsible: true
  70. }]
  71. });
  72. }
  73. };
  74. }();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement