Results 1 to 6 of 6

Thread: Why is extjs adding &node=root to my ajax url?

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    172
    Answers
    7

    Default Why is extjs adding &node=root to my ajax url?

    I'm trying to load a tree panel with data from the backend. Why is ExtJS adding &node=root to the url:

    http://localhost:8080/mysvc/rest/api...1545&node=root

    This is breaking my service call.

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    172
    Answers
    7

    Default

    Looks like something else was breaking my call, but still, why is that being added?

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347

    Default

    When a store needs to load data for a node, it will generate a request with a parameter named 'node' that contains id of that node. In your case, the request for loading is GET and node id is 'root' (which is loading root node) then node=root is added to the url of requesting.

  4. #4
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    43
    Answers
    2

    Default

    Yes, but more importantly, *why* does ExtJs do this?

    In my case, the server I'm talking to doesn't need or want this information. There *should* be a way to disable it.

    I found the nodeParam config on the TreeStore, but if I set it to "undefined", that just changes the text the Ajax request sends from "?node=..." to "?undefined=...". Not helpful.

    It's my guess that there's no easy/convenient way to disable this behavior. I think it can be done by overriding some code in ExtJs that sends the request, but I shouldn't have to go to those lengths to do something *that* simple!

    I'm fortunate in my case because my server seems to ignore everything after the question mark, but at some point I'll probably try to clean up the request just so it looks right.

    This is an area where the documentation could save people a *lot* of grief. In the TreeStore, if it mentioned this behavior, where it comes from, why it's there, and how to disable it, that would be immensely helpful.

  5. #5
    Sencha User metalinspired's Avatar
    Join Date
    Apr 2012
    Posts
    98
    Answers
    4

    Default

    I really don't see any reason to remove that from ExtJS.
    If you coded your server-side code correctly it shouldn't pose any problem whatsoever.

  6. #6
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    43
    Answers
    2

    Default

    I wasn't suggesting it be removed; that would be draconian. Instead, it'd be nice if there was a way to disable this behavior, because clearly not all situations require it.

Posting Permissions

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