4 wcmf.tree.Tree =
function(config) {
8 Ext.apply(
this, config);
11 var root =
new Ext.tree.AsyncTreeNode({
18 config.useArrows =
true,
19 config.autoScroll =
true,
20 config.animate =
true,
21 config.containerScroll =
true,
23 config.loader =
new wcmf.tree.TreeLoader({
24 dataUrl:
'<?php echo $APP_URL; ?>',
25 baseParams:{controller:
'<?php echo $controller; ?>', context:
'<?php echo $context; ?>', usr_action:
'loadChildren', response_format:
'JSON', sid:
'<?php echo session_id() ?>'}
28 wcmf.tree.Tree.superclass.constructor.call(
this, config);
31 if (this.customParams)
32 for (var i in this.customParams)
33 this.loader.baseParams.add(this.customParams[i]);
36 Ext.extend(wcmf.tree.Tree, Ext.tree.TreePanel, {
42 wcmf.tree.TreeLoader =
function(config) {
43 wcmf.tree.TreeLoader.superclass.constructor.call(
this, config);
45 Ext.extend(wcmf.tree.TreeLoader, Ext.tree.TreeLoader, {
46 processResponse :
function(response, node, callback) {
47 var responseArray = Ext.decode(response.responseText);
50 for(var i=0; i<responseArray[
'objects'].length; i++) {
51 var responseNode = responseArray[
'objects'][i];
53 'text':responseNode.text,
54 'id':responseNode.oid,
55 'leaf':!responseNode.hasChildren,
57 'qtipTitle':responseNode.oid,
58 'cls':responseNode.hasChildren ?
'folder' :
'file',
59 'href':responseNode.onClickAction
61 var n = this.createNode(nodeDef);
66 if(typeof callback ==
"function") {
70 this.handleFailure(response);
get($message, $parameters=null, $domain='', $lang='')
Use the Message class to output messages. You need not instantiate a Message object because the metho...