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.

46 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. Ext.QuickTips.init();
  9. var tree = new Ext.ux.tree.TreeGrid({
  10. title: 'Core Team Projects',
  11. width: 500,
  12. height: 300,
  13. renderTo: Ext.getBody(),
  14. enableDD: true,
  15. columns:[{
  16. header: 'Task',
  17. dataIndex: 'task',
  18. width: 230
  19. },{
  20. header: 'Duration',
  21. width: 100,
  22. dataIndex: 'duration',
  23. align: 'center',
  24. sortType: 'asFloat',
  25. tpl: new Ext.XTemplate('{duration:this.formatHours}', {
  26. formatHours: function(v) {
  27. if(v < 1) {
  28. return Math.round(v * 60) + ' mins';
  29. } else if (Math.floor(v) !== v) {
  30. var min = v - Math.floor(v);
  31. return Math.floor(v) + 'h ' + Math.round(min * 60) + 'm';
  32. } else {
  33. return v + ' hour' + (v === 1 ? '' : 's');
  34. }
  35. }
  36. })
  37. },{
  38. header: 'Assigned To',
  39. width: 150,
  40. dataIndex: 'user'
  41. }],
  42. dataUrl: 'treegrid-data.json'
  43. });
  44. });