Results 1 to 3 of 3

Thread: Loading data to tree store causes post request(Rest Proxy)

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

    Default Loading data to tree store causes post request(Rest Proxy)

    I am trying to create a tree panel with tree store(Rest Proxy). When I send the data on get request as below
    Code:
    [{
    		'leaf' : False,
    		'name' : 'A',
    		'idx' : 0,
    		'expanded' : False,
    		'dept' : '0',
    		'record_id' : 0,
    		'parentId' : 0,
    		'children' : [{
    				'leaf' : True,
    				'name' : 'child1A',
    				'idx' : 0,
    				'dept' : '0',
    				'record_id' : 1,
    				'parentId' : 0
    			}
    		]
    	}, {
    		'leaf' : False,
    		'name' : 'B',
    		'idx' : 1,
    		'expanded' : False,
    		'dept' : '1',
    		'_record_id' : 2,
    		'parentId' : 1,
    		'children' : [{
    				'leaf' : True,
    				'name' : 'child1B',
    				'idx' : 0,
    				'dept' : '0',
    				'_record_id' : 3,
    				'parentId' : 2
    			}
    		]
    	}
    ]
    I am getting POST request for every leaf nodes as below:

    POST Request - Body:
    {
    "data" : {
    "leaf" : true,
    "name" : "child1A",
    "idx" : 0,
    "dept" : "0",
    "_record_id" : 1,
    "parentId" : "extModel45-1",
    "id" : "extModel45-3"
    }
    }

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    You can control the request method using the actionMethods config.
    http://docs.sencha.com/extjs/6.0/6.0...-actionMethods

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

    Default

    Action method defaults to {create: 'POST', read: 'GET', update: 'PUT', destroy: 'DELETE'}

    This doesn't happen in Grid. When I response to a get request ,I am getting a post request for all the child node automatically. According to the REST(Ref: above default value), the POST should be called only when I create a new record/node. I want to stop this POST requests on GET request.

Similar Threads

  1. Replies: 3
    Last Post: 8 Jun 2016, 6:05 AM
  2. Loading a data store through REST web service proxy
    By anonymous123456789 in forum Ext: Discussion
    Replies: 1
    Last Post: 12 Jul 2012, 11:22 AM
  3. POST request with REST proxy
    By ljadrbln in forum Ext: Q&A
    Replies: 2
    Last Post: 10 Apr 2012, 5:41 PM
  4. ExtJs 4 Store Proxy / AJAX request POST xmlData
    By troseberry in forum Ext: Discussion
    Replies: 2
    Last Post: 23 Nov 2011, 7:56 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
  •