Problem with Ext.direct + Ext.tree


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/code-flow.club/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
3 views
I can't find documentation Ext.js and the source also does not help in this problem:
There is a tree (Ext.tree.treepanel).
It loaded the data using Ext.direct, config like this:
...
loader: new Ext.tree.TreeLoader({
directFn: docs.getDocList
}),
...


I want to send another parameter (in addition to the id_node, which is sent automatically) when uploading the data.
Maybe someone faced similar problem?
by | 3 views

2 Answers

0 like 0 dislike
paramsAsHash: Boolean
Only used when using directFn. Send parameters as a collection of named arguments (defaults to false). Providing a paramOrder nullifies this configuration.
\r

\r
Judging by the TreeLoader source, if you specify directFn, baseParams (!) paramsAsHash, it will be all chocolate.
\r
\r
requestData : function(node, callback, scope){ if(this.fireEvent("beforeload", this, node, callback) !== false){ if(this.directFn){ var args = this.getParams(node); args.push(this.processDirectResponse.createDelegate(this, [{callback: callback, node: node, scope: scope}], true)); this.directFn.apply(window, args); } ... } ... getParams: function(node){ var bp = Ext.apply({}, this.baseParams), np = this.nodeParameter, po = this.paramOrder; np && (bp[ np ] = node.id); if(this.directFn){ var buf = [node.id]; ... if(this.paramsAsHash){ buf = [bp]; } return buf; ... } 
by
0 like 0 dislike
Read the manual to TreeLoader. Almost immediately we see:
\r
To pass extra parameters, an event handler may be attached to the "beforeload" event, and the parameters specified in the TreeLoader''s baseParams property.
\r

\r
So documentation and baseParams.
by

Related questions

0 like 0 dislike
2 answers
asked Mar 24, 2019 by MrSLonoed
0 like 0 dislike
3 answers
asked Mar 28, 2019 by baroleg
0 like 0 dislike
1 answer
asked Mar 24, 2019 by udachnik
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
24,677 users