Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | var TableTree = function() { |
| 2 | |||
| 3 | var demo1 = function() { |
||
| 4 | |||
| 5 | jQuery('#gtreetable').gtreetable({ |
||
| 6 | 'draggable': true, |
||
| 7 | 'source': function(id) { |
||
| 8 | return { |
||
| 9 | type: 'GET', |
||
| 10 | url: 'demo/table_tree.php', |
||
| 11 | data: { |
||
| 12 | 'id': id |
||
| 13 | }, |
||
| 14 | dataType: 'json', |
||
| 15 | error: function(XMLHttpRequest) { |
||
| 16 | alert(XMLHttpRequest.status + ': ' + XMLHttpRequest.responseText); |
||
| 17 | } |
||
| 18 | } |
||
| 19 | }, |
||
| 20 | 'sort': function (a, b) { |
||
| 21 | var aName = a.name.toLowerCase(); |
||
| 22 | var bName = b.name.toLowerCase(); |
||
| 23 | return ((aName < bName) ? -1 : ((aName > bName) ? 1 : 0)); |
||
| 24 | }, |
||
| 25 | 'types': { default: 'glyphicon glyphicon-folder-open', folder: 'glyphicon glyphicon-folder-open'}, |
||
| 26 | 'inputWidth': '255px' |
||
| 27 | }); |
||
| 28 | } |
||
| 29 | |||
| 30 | return { |
||
| 31 | |||
| 32 | //main function to initiate the module |
||
| 33 | init: function() { |
||
| 34 | |||
| 35 | demo1(); |
||
| 36 | } |
||
| 37 | |||
| 38 | }; |
||
| 39 | |||
| 40 | }(); |