View Full Version : Web Service for TreePanel loader?
TomKohl
7 Mar 2007, 9:38 AM
Is it possible to call a Web Service Method for the TreePanel loader?
For example (this does not work but looking to do something like this),
var tree = new Tree.TreePanel('DataFieldsTree', {
animate:true,
enableDD:true,
containerScroll:true,
loader: new Tree.TreeLoader({dataUrl:'DataFields.asmx',WebMethod:'GetDataFields'}),
dropConfig: {appendOnly:true}
});
brian.moeskau
7 Mar 2007, 10:05 AM
The short answer is no. Ajax calls are inherently url-based and must use either GET or POST requests. Since .NET web services (.asmx files) use SOAP, you have to have a proxy layer of some sort that can translate to and from SOAP syntax. See an example here:
http://www.codeproject.com/soap/JavaScriptProxy_01.asp
One possible workaround is to create a traditional aspx page that can wrap calls to your web service, and POST or GET to the aspx page. That way you can load the tree by doing: Load.aspx?data=foo and the aspx would actually have the web reference and be able to call the web service, get the response, and format the data back into JSON or whatever you need for loading the tree.
tryanDLS
7 Mar 2007, 10:10 AM
The other possibility is to write a layer that does all the SOAP wrapping (e.g. add the namespace and soap envelope stuff) for the webservice call and then passes that to the Connection object to do the Ajax request. You also have to make an initial call to get the WSDL for the webservice, but once you have the WSDL, you can cache it on the client, so subsequent calls can use it.
DragonFist
20 Sep 2007, 6:39 AM
I have the javascriptproxy library and have even extended the dataproxy to make use of it which works well for me on the grid but on the tree, i have failed to get it to work.
I can use it it assign to the "children:" property but this doesn't reload. on the dataUrl property of the loader, I have gotten no response.
Any Ideas?
Edit: I guess what I am looking for is a way to proxy the loader for a tree like you can for a grid.
DragonFist
20 Sep 2007, 12:31 PM
Nevermind, I figured out how to extend the treeloader to handle it.
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.