Results 1 to 7 of 7

Thread: Accessing params to current grid's datasource url?

  1. #1

    Default Accessing params to current grid's datasource url?

    Hi,

    Is there an easy way to access the url that generated the data for the current page of data on the grid? Including the start, limit, baseParams, sort, and dir? I want to call the script that generated the xml or json for what's currently in view, but instead have it generate a printable html view of the current data in the grid, in a new window...

    How can I access that current url?

    Thanks,

    Matt

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    You'll have to navigate thru the object properties. Not tested, but something like
    Code:
    grid.getDataSource().proxy.getConnection().url

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    47

    Default

    Hi frinds,

    i am in trouble with grid related issue....

    I am trying to show my grid in my center grid panel , When i submit my search page which is in west panel inside an iframe..i am not able to pass parameters from my iframe to its parent panel.so that i am not able to generate grid.

    the control flow i am following is correct or not i am not sure about that. plese i need some help

    here is my thread http://extjs.com/forum/showthread.php?t=6312
    joxan

  4. #4

    Default

    Quote Originally Posted by tryanDLS View Post
    You'll have to navigate thru the object properties. Not tested, but something like
    Code:
    grid.getDataSource().proxy.getConnection().url
    Thanks. That works in that it gives me the url with no parameters, eg "/cgi/script.pl?" ..

    Any idea if there is something like grid.getDataSource().proxy.getConnection().params ?

    I'm looking but haven't found anything yet..

    Matt

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    params aren't stored as a property of the connection - they're just passed to the request fn with the options object. The store object has a property baseParams and it also stores the options passed to load as the lastOptions property.

    If you needed to access them from the Connection object, you could add a handler for the beforeload event (which gets params as an arg) and store them as a property of the Connection object.

  6. #6

    Default

    Quote Originally Posted by tryanDLS View Post
    params aren't stored as a property of the connection - they're just passed to the request fn with the options object. The store object has a property baseParams and it also stores the options passed to load as the lastOptions property.

    If you needed to access them from the Connection object, you could add a handler for the beforeload event (which gets params as an arg) and store them as a property of the Connection object.
    I don't need access specifically from the Connection object, I'll take it from anywhere I can get it. I'm adding a button to the toolbar and need to access to the same cgi parameters that were used to get the xml data from the script which gave the data for the current grid. BaseParams, paging params, and all.

    Can I get this from the data Store using lastOptions, then?

    Thanks,

    Matt

  7. #7

    Default

    Quote Originally Posted by lemontree View Post
    I don't need access specifically from the Connection object, I'll take it from anywhere I can get it. I'm adding a button to the toolbar and need to access to the same cgi parameters that were used to get the xml data from the script which gave the data for the current grid. BaseParams, paging params, and all.

    Can I get this from the data Store using lastOptions, then?

    Thanks,

    Matt
    Ok, I think you pointed me in the right direction..

    I can get the url from:
    grid.getDataSource().proxy.getConnection.url

    I can get the rest of the params (limit, start, sort, dir, custom base ones), for each cgi paramValue, from:
    datasource.lastOptions['params'].paramValue

    I think that this will do what I need. Thanks again..

    Matt

Posting Permissions

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