Results 1 to 4 of 4

Thread: Ext Tree and JSON-RPC

  1. #1

    Default Ext Tree and JSON-RPC

    Hi!

    I am trying Ext Tree right now, and wanted to obtain my data using JSON-RPC. JSON-RPC is an Ajax Java Framework that allows you easily call your java functions via AJAX. Therefore, you need to make a specific HTTP POST call containing a JSON msg.

    This is a correct HTTP POST params to my JSON-RPC Servlet in Firebug:
    Code:
    {"id": 1, "method": "system.listMethods", "params": []}
    So i need to make a call via Ext Tree Loader so that HTTP POST params look like the one above. I don't know if this is possible. It always adds a node param with value source
    Code:
    node source
    Any ideas of hos to do this for Ext.TreeLoader????

    Thank you!!!

  2. #2
    Ext JS Premium Member
    Join Date
    Apr 2007
    Location
    Eindhoven
    Posts
    115

    Default tree before load

    You can add parameters send when clicking a leaf
    Code:
    tree.loader.on("beforeload", function(treeLoader, node) {
                treeLoader.baseParams.node_id = node.attributes.node_id;
                treeLoader.baseParams.child_id = node.attributes.child_id;
                treeLoader.baseParams.invent = node.attributes.invent;
            });
    The above code adds value's to some baseParams in the tree loader before the tree loader loads the url. Maybe you can use this to add the id etc.

  3. #3

    Default

    Thank you for answer damien, but i think i have not explained well enough.
    Is in the first load, when i have no leafs in my tree, and i want to load them from a specific url, when i am having troubles.

    All i need is being able to send a HTTP POST request to an url sending following parameter:
    extracted from FireBug

    {"id": 1, "method": "system.listMethods", "params": []}
    How can i do that using dataUrl from Ext Tree Loader ?

    So i want that the request made by TreeLoader holds an unique parameter, that is a JSON Object/Element.

    Any suggestions??

    Thank you!!!

  4. #4
    Sencha User
    Join Date
    May 2008
    Location
    Poland
    Posts
    11

    Default

    im also having this problem. anyones got any advice so far?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •