Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * Ext JS Library 3.3.1
  3. * Copyright(c) 2006-2010 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. Ext.onReady(function(){
  8. // create the Data Store
  9. var store = new Ext.data.Store({
  10. // load using HTTP
  11. url: 'sheldon.xml',
  12. // the return will be XML, so lets set up a reader
  13. reader: new Ext.data.XmlReader({
  14. // records will have an "Item" tag
  15. record: 'Item',
  16. id: 'ASIN',
  17. totalRecords: '@total'
  18. }, [
  19. // set up the fields mapping into the xml doc
  20. // The first needs mapping, the others are very basic
  21. {name: 'Author', mapping: 'ItemAttributes > Author'},
  22. 'Title', 'Manufacturer', 'ProductGroup'
  23. ])
  24. });
  25. // create the grid
  26. var grid = new Ext.grid.GridPanel({
  27. store: store,
  28. columns: [
  29. {header: "Author", width: 120, dataIndex: 'Author', sortable: true},
  30. {header: "Title", width: 180, dataIndex: 'Title', sortable: true},
  31. {header: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true},
  32. {header: "Product Group", width: 100, dataIndex: 'ProductGroup', sortable: true}
  33. ],
  34. renderTo:'example-grid',
  35. width:540,
  36. height:200
  37. });
  38. store.load();
  39. });