1. #1
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    7
    Vote Rating
    0
    william1000 is on a distinguished road

      0  

    Default Dynamic Store Configuration

    Dynamic Store Configuration


    I'm new to Ext Designer and have a question on how to dynamically create the proxy / store URL for loading data from the server.

    For example, let's say I want to load a list of orders for a particular customer using a Store. The server-side URL that handles order may be "userOrders.php". One of the arguments the server expects is the customer-id, so that the server will select only the orders for a particular customer.

    How would I do this in Ext Designer? How do I pass dynamic arguments to the URL field for a proxy / store?

    Thanks!

  2. #2
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,273
    Vote Rating
    81
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    The only recomendation I can give to you is dont use Designer's stores, write it by hand and instantiate in the initComponent() method.

    Designer's support for models and stores is weak to my point of view.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    13
    Vote Rating
    0
    gwinning is on a distinguished road

      0  

    Default


    Assuming you know about the.js file generated that you edit to add your event handlers, the below code is what worked for me to call the relative url to a .p (similar to a .php) with parameters.

    onBtnGroupClick: function() {
    try{
    var strSearch = Ext.getCmp("txtGroup").getValue();
    if (strSearch == "") {
    alert("You must enter a group to search for.");
    return;
    }
    var cs = Ext.StoreMgr.get("CustStore");
    var myProxy = cs.getProxy();
    myProxy.url = "/scripts/codexdv1.wsc/JSONFindCustomer.p?Mode=GroupName&FilterValue=" + strSearch;
    cs.load();
    }
    catch(err){
    alert("Error in BtnGroupClick: \n\n" + err.description);
    }
    }

Thread Participants: 2