-
30 Sep 2010 9:53 PM #1
TreePanel accept header
TreePanel accept header
Is there any way to specify headers (specifically, the accept header) with a treepanel?
I do not wish to override the headers used globally with EXT, just the ones specifically for an instance of treepanel.
Thanks for the help!
-
30 Sep 2010 11:29 PM #2
Clear language: Are you talking about HTTP headers?
You will have to extend Ext.tree.TreeLoader, and implement your own requestData method.
IMHO, this method should be fully documented so that people can plug in their own imlpementations easily. It's not difficult though, just take a look at the source.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
1 Oct 2010 4:52 AM #3
Hmm. I'm a bit confused.
Other components allow me to specify headers as an object. Is there any way I can do this without extending the class? Maybe just by decorating it or overriding some aspect of it?
Just trying to look for the simplest solution...
-
1 Oct 2010 6:09 AM #4
OK, now I'm confused. What other components allow you to specify headers as an object? Just so I understand what you mean.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
1 Oct 2010 9:48 AM #5
myForm.getForm().load({
method: "GET",
url: "MyURL",
success : function() {
pageEditor.el.unmask();
},
// Specify custom headers.
headers: {
// Inform the server that we're saving as part of an ext-js FormPanel object's lifecycle.
"Accept": "blah/blahblahblah"
}
});
-
1 Oct 2010 9:54 AM #6
Right, extend and override this
Code: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); }else{ this.transId = Ext.Ajax.request({ method:this.requestMethod, url: this.dataUrl||this.url, success: this.handleResponse, failure: this.handleFailure, scope: this, argument: {callback: callback, node: node, scope: scope}, params: this.getParams(node) }); } }else{ // if the load is cancelled, make sure we notify // the node that we are done this.runCallback(callback, scope || node, []); } },Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
1 Oct 2010 9:56 AM #7
How or where exactly would I put this code?
Also, bear in mind the example I gave you was for a FormPanel as an example. I want to add an HTTP accept-header to a TreePanel's async request.
Similar Threads
-
[2.x/3.x] Not accept the choice of 18,19 dates
By Fabyo in forum Ext 2.x: BugsReplies: 2Last Post: 25 Sep 2009, 7:56 AM -
Can TimeField accept any value not in its store?
By taocore in forum Ext GWT: DiscussionReplies: 0Last Post: 30 Jul 2009, 9:13 PM -
Can a NestedLayoutPanel accept a toolbar?
By manxomfoe in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 31 Oct 2006, 5:19 PM


Reply With Quote