1. #11
    Ext User swagner's Avatar
    Join Date
    Jan 2008
    Location
    Munich, Germany
    Posts
    88
    Vote Rating
    0
    swagner is on a distinguished road

      0  

    Default Example

    Example


    @jsakalos: I would like to know how your created javascript code at the start of the page looks exactly like when you write the settings for a grid. Can you give me an example-line of code for your line (i am interessted especially in the columns-part) :
    Code:
    Ext.state.Manager.getProvider().initState([{"name":"client-mod-client-grid","value":"..."}

  2. #12
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,165
    Vote Rating
    322
    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


    The logic is simple: There is a server side script that retrieves saved state from database and generates the whole output enclosed in <script></script> tags together with initial state json.

    What "columns-part" do you mean, I don't see it there?
    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. #13
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    Did you guys take a look at the hybrid provider in the examples/state folder? It uses server side state (for the the example its in the session, but could go into a DB ).

    Unlike fetching/saving of state over HTTP, it uses cookies with state, which the server collects and removes. Using this hybrid approach, there are no extra requests or processing, no big cookies being stored (they are removed by the server), the state is stored on the server and is available immediately when the page loads.
    Jack Slocum
    Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum
    jack@extjs.com

  4. #14
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,165
    Vote Rating
    322
    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


    Thanks for info Jack, I haven't seen it before.

    Anyway, I'll keep HttpProvider in my application(s) because I've run several times into the problem when my Apache server complained about size of cookies when I was using CookieProvider. The only way how to run out of that problem was to delete cookies at client.

    Therefore, I've completely dropped the idea of cookies holding state information and the example also uses cookies, with less risk of crossing a boundary of size though.
    Jozef Sakalos, aka Saki

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


  5. #15
    Ext User DigitalSkyline's Avatar
    Join Date
    Apr 2007
    Location
    Rochester, MI
    Posts
    461
    Vote Rating
    0
    DigitalSkyline is on a distinguished road

      0  

    Default


    Jack - that actually sounds more in line with how I'd like to handle things, going to have to look in to it. Thanks for the suggestion!

  6. #16
    Ext User swagner's Avatar
    Join Date
    Jan 2008
    Location
    Munich, Germany
    Posts
    88
    Vote Rating
    0
    swagner is on a distinguished road

      0  

    Thumbs up


    Yes, good to know. My custom Provider is actually working fine (thanks to jsakalos (and his example code)) and the data goes as hash into my database instead into a cookie. While transfering the encodeValued hash, this hash is loosing it's urlencoding. So i urlencode my hash from the database when i get it and write it into the initState-method (of my Provider) at the start of my page (as jsakalos does). I decodeValue this hash in my Provider and receive a state object which i set as my state then. The grid gets rendered with the settings from the database afterwards.
    Last edited by swagner; 14 Feb 2008 at 12:45 AM. Reason: misspelled something

  7. #17
    Ext User
    Join Date
    Jan 2008
    Posts
    32
    Vote Rating
    0
    iwtrading is on a distinguished road

      0  

    Default


    Hi Jozef,

    Thank you for your work.

    I try HttpProvider to restore a window position and size, but it doesn't work.
    I don't know where my error is.

    Code:
      var prv = Ext.state.Manager.getProvider();
      prv.on('readsuccess', function() {
          var w = Ext.getCmp('mywindow');
          w.initState();
          // w.render();
          // w.doLayout();
          w.show();
     });
     prv.readState();
    ...

  8. #18
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,165
    Vote Rating
    322
    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


    Do you initialize provider as described here http://extjs.com/forum/showthread.ph...791#post119791 ?
    Jozef Sakalos, aka Saki

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


  9. #19
    Ext User
    Join Date
    Jan 2008
    Posts
    32
    Vote Rating
    0
    iwtrading is on a distinguished road

      0  

    Default


    Quote Originally Posted by jsakalos View Post
    Do you initialize provider as described here http://extjs.com/forum/showthread.ph...791#post119791 ?
    Yes I do.

    I have seen that invoking more times the method:
    Code:
                            
      var prv = Ext.state.Manager.getProvider();
      prv.submitState();
    The new window position is appended on http request:
    Code:
    [http params]
    cmd=saveState&data=%5B%7B%22
    name%22%3A%22mywindow%22%2C%22value%22%3A%22o%253Awidth%253Dn%25253A700%255Eheight%253Dn%25253A302%255Ex%253Dn%25253A290%255Ey%253Dn%25253A175%22%7D%2C%7B%22
    name%22%3A%22mywindow%22%2C%22value%22%3A%22o%253Awidth%253Dn%25253A356%255Eheight%253Dn%25253A302%255Ex%253Dn%25253A290%255Ey%253Dn%25253A175%22%7D%2C%7B%22
    name%22%3A%22mywindow%22%2C%22value%22%3A%22o%253Awidth%253Dn%25253A356%255Eheight%253Dn%25253A302%255Ex%253Dn%25253A290%255Ey%253Dn%25253A175%22%7D%5D&id=1
    Should "mywindow" params appear only once?

  10. #20
    Ext User
    Join Date
    Jan 2008
    Posts
    32
    Vote Rating
    0
    iwtrading is on a distinguished road

      0  

    Default


    Is this a possible solution?
    Code:
        queueChange:function(name, value) {
            var changed = undefined === this.state[name] || this.state[name] !== value;
            var o = {};
            if(changed) {
                o[this.paramNames.name] = name;
                o[this.paramNames.value] = this.encodeValue(value);
                var found = false;
                for (var ii=0; ii<this.queue.length-1; ii++) {
                    if (this.queue[ii].name == o.name) {
                        this.queue[ii] = o;
                        found = true;
                    }
                }
                if (!found) {
                    this.queue.push(o);
                }
                this.dirty = true;
            }
            return changed;
        },

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