property.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Ext.require([
  2. 'Ext.button.Button',
  3. 'Ext.grid.property.Grid'
  4. ]);
  5. Ext.onReady(function(){
  6. // simulate updating the grid data via a button click
  7. Ext.create('Ext.button.Button', {
  8. renderTo: 'button-container',
  9. text: 'Update source',
  10. handler: function(){
  11. propsGrid.setSource({
  12. '(name)': 'Property Grid',
  13. grouping: false,
  14. autoFitColumns: true,
  15. productionQuality: true,
  16. created: new Date(),
  17. tested: false,
  18. version: 0.8,
  19. borderWidth: 2
  20. });
  21. }
  22. });
  23. var propsGrid = Ext.create('Ext.grid.property.Grid', {
  24. width: 300,
  25. renderTo: 'grid-container',
  26. propertyNames: {
  27. tested: 'QA',
  28. borderWidth: 'Border Width'
  29. },
  30. source: {
  31. "(name)": "Properties Grid",
  32. "grouping": false,
  33. "autoFitColumns": true,
  34. "productionQuality": false,
  35. "created": Ext.Date.parse('10/15/2006', 'm/d/Y'),
  36. "tested": false,
  37. "version": 0.01,
  38. "borderWidth": 1
  39. }
  40. });
  41. });