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 tree = new Ext.tree.TreePanel({
  9. renderTo:'tree-div',
  10. title: 'My Task List',
  11. height: 300,
  12. width: 400,
  13. useArrows:true,
  14. autoScroll:true,
  15. animate:true,
  16. enableDD:true,
  17. containerScroll: true,
  18. rootVisible: false,
  19. frame: true,
  20. root: {
  21. nodeType: 'async'
  22. },
  23. // auto create TreeLoader
  24. dataUrl: 'check-nodes.json',
  25. listeners: {
  26. 'checkchange': function(node, checked){
  27. if(checked){
  28. node.getUI().addClass('complete');
  29. }else{
  30. node.getUI().removeClass('complete');
  31. }
  32. }
  33. },
  34. buttons: [{
  35. text: 'Get Completed Tasks',
  36. handler: function(){
  37. var msg = '', selNodes = tree.getChecked();
  38. Ext.each(selNodes, function(node){
  39. if(msg.length > 0){
  40. msg += ', ';
  41. }
  42. msg += node.text;
  43. });
  44. Ext.Msg.show({
  45. title: 'Completed Tasks',
  46. msg: msg.length > 0 ? msg : 'None',
  47. icon: Ext.Msg.INFO,
  48. minWidth: 200,
  49. buttons: Ext.Msg.OK
  50. });
  51. }
  52. }]
  53. });
  54. tree.getRootNode().expand(true);
  55. });