1. #1
    Ext User denkoo's Avatar
    Join Date
    Jan 2008
    Location
    Paris
    Posts
    124
    Vote Rating
    0
    denkoo is on a distinguished road

      0  

    Cool [2.x] Ext.denkoo.fewQuery : Only One AJax Request=>many DataStore For loading COMBO

    [2.x] Ext.denkoo.fewQuery : Only One AJax Request=>many DataStore For loading COMBO


    Hi,

    I'm beginer on Ext Developpement, so My code is not perfect... sorry ))

    This Ext can populate 10,20 or 30 combos on your form with only one AjaxQuery

    A listener of AjaxRequest populate datastore of each COMBO.

    Syntaxe for init the Ajax Request :
    PHP Code:
     Ext.ux.denkoo.fewQuery.init();  // RAZ
    // param in add method => add (idDS, "Task to ask data server","table bdd", Objet config transmit to server by POST)
     
    Ext.ux.denkoo.fewQuery.add("society","listLoad","societyTable",{select :"idtiers, denomination"sort"denomination"dir"ASC"});
     
    Ext.ux.denkoo.fewQuery.add("fonction","listLoad","fonctionTable",{select :"idtiersFonction"sort"idtiersFonction"dir"ASC"});
     
    Ext.ux.denkoo.fewQuery.add("unite","listLoad","uniteTable",{select :"unite"sort"unite"dir"ASC"});
     
    Ext.ux.denkoo.fewQuery.load(); 
    and for each COMBO :
    PHP Code:
    // param in getDs method => getDs (idDS)
    storeExt.ux.denkoo.fewQuery.getDs("society"), 
    Full online example :

    http://213.251.166.160/~extjs/examples/fewQuery/fewquery.htm

    Denkoo
    Attached Files

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,167
    Vote Rating
    323
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    What happens if data in the underlying table changes - do I need to reload all stores or can I do it on per-store basis?
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Blessing and Curse of refs, Grid MultiSearch Plugin


  3. #3
    Ext User denkoo's Avatar
    Join Date
    Jan 2008
    Location
    Paris
    Posts
    124
    Vote Rating
    0
    denkoo is on a distinguished road

      0  

    Thumbs up you can do it on per-store basis

    you can do it on per-store basis


    this Extension do :
    0. with method this.init() => RAZ all data and dataStore
    1. with method this.add(config)
    => collect all your requests... and affect on each an ID (idQuery)
    => create Ext.data.simpleStore with
    data: this.myEmptyArray,
    fields: Ext.decode(myConfigParamSELECT)
    3. when you use method this.load()=>
    => generate only one requete => send it to server width Ajax
    => listener : load
    + responseText=>parse DATA=>populate this.myEmptyArray (in data.simpleStore)


    Note: method this.getDs( idQuery )=>get Datastore width this idQuery

    **********************************

    So it's real Ext.data.simpleStore... you make all operation you doing with data.simpleStore habitualy ))

    thanks for your Post and I will be please if you find some interest on this Extension when I see all your contribute ))

    gratz

    denkoo

  4. #4
    Ext User denkoo's Avatar
    Join Date
    Jan 2008
    Location
    Paris
    Posts
    124
    Vote Rating
    0
    denkoo is on a distinguished road

      0  

    Thumbs up nota... this Extension debug another problem

    nota... this Extension debug another problem


    When I populate my forms, randomely, Combo not display displayField, but valueField only. I refresh and sometime it's Ok, other time, not...

    With this extension, I'm not constat this problem... It's the pleasant gift will make me great surprise )

    force be with you )

  5. #5
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,167
    Vote Rating
    323
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Well, I still don't know... If I use my server database in multiuser environment it can happen, and it happens, that another user changes data in the table that is used as row source for a combo.

    Now, I need to reload the combo's store to get fresh data. The question is if I can reload only one store this extension keeps or if I need to reload all stores for all combos?
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Blessing and Curse of refs, Grid MultiSearch Plugin


  6. #6
    Ext User denkoo's Avatar
    Join Date
    Jan 2008
    Location
    Paris
    Posts
    124
    Vote Rating
    0
    denkoo is on a distinguished road

      0  

    Thumbs up No.... but now it's ok )) => v0.2

    No.... but now it's ok )) => v0.2


    Sure, I have only "fields" and "data" parameter on my datastore, so you can't call load or reload on it !

    So, i create method reload, for doing that (v0.2):

    see the demo in online version :
    http://213.251.166.160/~extjs/examples/fewQuery0.2/fewquery.htm

    PHP Code:
        Ext.ux.denkoo.fewQuery.reload("unite"); // for reloding dataStore 'unite'
        
    Ext.ux.denkoo.fewQuery.reload("society""fonction"); // for reloding dataStore 'society' and 'fonction' width only one request 
    roadmap:

    => choice type of datastore (grouping, json... with affected URL for reloading independantly [usefull on datagrid])
    => integrated link betwen 2 combos (listener metod + filter)
    Attached Files

  7. #7
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,167
    Vote Rating
    323
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Hmmm,

    if there are only fields and data you can just create static arrays available on page load. Something like this:

    PHP Code:
    <script type="text/javascript">
    MyScope.store1data = {
         
    fields:[ .... ]
        ,
    data:[ .... ]
    };
    MyScope.store2data = {
         
    fields:[ .... ]
        ,
    data:[ .... ]
    };
    </script> 
    This solution is suitable only for static data (data that change very rarely) and for stores with only a few records. With this setup you need 0 extra client/server round trips and you can be sure that data is available before you try to combo.setValue().
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Blessing and Curse of refs, Grid MultiSearch Plugin


Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar