Results 1 to 6 of 6

Thread: How to response for a tree store from rest proxy

  1. #1
    Sencha User
    Join Date
    Dec 2013
    Location
    India
    Posts
    18

    Default How to response for a tree store from rest proxy

    Hi,
    I am facing problem in sending the response to the GET proxy request.

    I am using a treestore with REST proxy. No root property is set.
    I am providing response as below:
    {
    children: [{ "name" : "node",
    "expanded": false,
    "children" : [{"name" : "child", "leaf": true}],
    "leaf": false
    }],
    success: true
    }

    I am getting the root above this which I could remove my adding rootVisible->False both Treestore and treepanel. Name is the data index of the tree column I use

    Please help me on how to send the data and what is the format?

  2. #2
    Sencha User
    Join Date
    May 2009
    Posts
    300
    Answers
    6

    Default

    Does placing double quotes around "success" and "children" help?
    Code:
    {  
       "success":true,
       "children":[  
          {  
             "name":"node",
             "expanded":false,
             "children":[  
                {  
                   "name":"child",
                   "leaf":true
                }
             ],
             "leaf":false
          }
       ]
    }

  3. #3
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962
    Answers
    55

    Default

    Hi--,

    What does the store definition look like? Can you provide an example, Fiddle is best, demonstrating your scenario so we can review?

    Best!
    Bryan

  4. #4
    Sencha User
    Join Date
    Dec 2013
    Location
    India
    Posts
    18

    Default

    I am not sure, how to create a rest proxy in fiddle. It is a simple example as above data to be shown in a tree.

    I found the issue, the response is similar to the Tampa's reply. But still when I respond to GET request as above. I am getting unwanted POST request for each children.

  5. #5
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962
    Answers
    55

    Default

    It might require adding a loaded:true as part of the response, natively it will try and load children with service request calls.

    Take a look at this Tree Guide, has some useful information regarding other variables to include.

    https://docs.sencha.com/extjs/6.0/components/trees.html


    Best!
    Bryan

  6. #6
    Sencha User
    Join Date
    Dec 2013
    Location
    India
    Posts
    18

    Default

    Thanks for the documentation.I looked into it, the loaded should be added to the node which has no children.If I add it to the node with children , children are not loaded.

    The problem is when using proxy and loading all the data where the root is expanded not its children. The POST request is called for each and every child in the tree after first GET request.The same happens on each and every expand I do.

    I just want to stop this unwanted POST requests.

Similar Threads

  1. Replies: 3
    Last Post: 8 Jun 2016, 6:05 AM
  2. Loading data to tree store causes post request(Rest Proxy)
    By yuvabarath in forum Ext JS 6.x Q&A
    Replies: 2
    Last Post: 9 Mar 2016, 9:25 PM
  3. REST Proxy Server Response
    By jwargo in forum Ext: Q&A
    Replies: 2
    Last Post: 17 Apr 2013, 4:53 AM
  4. REST proxy server response when creating
    By aatiis in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 13 Jan 2013, 6:42 PM
  5. Rest Proxy and Htp Response
    By srxx123 in forum Ext: Discussion
    Replies: 5
    Last Post: 16 Aug 2012, 7:27 AM

Tags for this Thread

Posting Permissions

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