Last change
on this file since 619 was
619,
checked in by ramonb, 15 years ago
|
lib/:
- added new AJAX dependancies: ExtJS, pChart, Lightbox2
|
File size:
1.6 KB
|
Rev | Line | |
---|
[619] | 1 | /* |
---|
| 2 | * Ext JS Library 2.2.1 |
---|
| 3 | * Copyright(c) 2006-2009, Ext JS, LLC. |
---|
| 4 | * licensing@extjs.com |
---|
| 5 | * |
---|
| 6 | * http://extjs.com/license |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | |
---|
| 10 | Ext.onReady(function(){ |
---|
| 11 | var tree = new Ext.tree.TreePanel({ |
---|
| 12 | renderTo:'tree-div', |
---|
| 13 | title: 'My Task List', |
---|
| 14 | height: 300, |
---|
| 15 | width: 400, |
---|
| 16 | useArrows:true, |
---|
| 17 | autoScroll:true, |
---|
| 18 | animate:true, |
---|
| 19 | enableDD:true, |
---|
| 20 | containerScroll: true, |
---|
| 21 | rootVisible: false, |
---|
| 22 | frame: true, |
---|
| 23 | root: { |
---|
| 24 | nodeType: 'async' |
---|
| 25 | }, |
---|
| 26 | |
---|
| 27 | // auto create TreeLoader |
---|
| 28 | dataUrl: 'check-nodes.json', |
---|
| 29 | |
---|
| 30 | listeners: { |
---|
| 31 | 'checkchange': function(node, checked){ |
---|
| 32 | if(checked){ |
---|
| 33 | node.getUI().addClass('complete'); |
---|
| 34 | }else{ |
---|
| 35 | node.getUI().removeClass('complete'); |
---|
| 36 | } |
---|
| 37 | } |
---|
| 38 | }, |
---|
| 39 | |
---|
| 40 | buttons: [{ |
---|
| 41 | text: 'Get Completed Tasks', |
---|
| 42 | handler: function(){ |
---|
| 43 | var msg = '', selNodes = tree.getChecked(); |
---|
| 44 | Ext.each(selNodes, function(node){ |
---|
| 45 | if(msg.length > 0){ |
---|
| 46 | msg += ', '; |
---|
| 47 | } |
---|
| 48 | msg += node.text; |
---|
| 49 | }); |
---|
| 50 | Ext.Msg.show({ |
---|
| 51 | title: 'Completed Tasks', |
---|
| 52 | msg: msg.length > 0 ? msg : 'None', |
---|
| 53 | icon: Ext.Msg.INFO, |
---|
| 54 | minWidth: 200, |
---|
| 55 | buttons: Ext.Msg.OK |
---|
| 56 | }); |
---|
| 57 | } |
---|
| 58 | }] |
---|
| 59 | }); |
---|
| 60 | |
---|
| 61 | tree.getRootNode().expand(true); |
---|
| 62 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.