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.

59 lines
1.6 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. var store = new Ext.data.JsonStore({
  9. url: 'get-images.php',
  10. root: 'images',
  11. fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date', dateFormat:'timestamp'}]
  12. });
  13. store.load();
  14. var listView = new Ext.list.ListView({
  15. store: store,
  16. multiSelect: true,
  17. emptyText: 'No images to display',
  18. reserveScrollOffset: true,
  19. columns: [{
  20. header: 'File',
  21. width: .5,
  22. dataIndex: 'name'
  23. },{
  24. header: 'Last Modified',
  25. xtype: 'datecolumn',
  26. format: 'm-d h:i a',
  27. width: .35,
  28. dataIndex: 'lastmod'
  29. },{
  30. header: 'Size',
  31. dataIndex: 'size',
  32. tpl: '{size:fileSize}',
  33. align: 'right',
  34. cls: 'listview-filesize'
  35. }]
  36. });
  37. // put it in a Panel so it looks pretty
  38. var panel = new Ext.Panel({
  39. id:'images-view',
  40. width:425,
  41. height:250,
  42. collapsible:true,
  43. layout:'fit',
  44. title:'Simple ListView <i>(0 items selected)</i>',
  45. items: listView
  46. });
  47. panel.render(document.body);
  48. // little bit of feedback
  49. listView.on('selectionchange', function(view, nodes){
  50. var l = nodes.length;
  51. var s = l != 1 ? 's' : '';
  52. panel.setTitle('Simple ListView <i>('+l+' item'+s+' selected)</i>');
  53. });
  54. });