Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User R56's Avatar
    Join Date
    Mar 2011
    Posts
    32
    Vote Rating
    0
    R56 is on a distinguished road

      0  

    Default Ext.data.Store.sync()

    Ext.data.Store.sync()


    Hi,

    I don't know, maybe I'm doing something wrong or maybe it's not supposed to work like in ExtJs4 but if I do:
    Code:
    var s = Ext.create('Ext.data.Store', { model: 'PreDefinedModel', autoLoad: true });
    Then wait til the store is loaded(model is defined with a REST proxy) and ...
    Code:
    s.remove(s.getAt(4));
    s.sync();
    ... I get an "TypeError: Cannot call method 'destroy' of undefined"-error.
    Same error goes with the update method when I change any record and then sync.

    It's getting more and more ridiculous by the moment.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The data package got some updating since PR3 and there are bugs that are fixed that has to do with sync and getting the undefined error:

    http://www.sencha.com/forum/showthread.php?158618
    http://www.sencha.com/forum/showthread.php?153408
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User R56's Avatar
    Join Date
    Mar 2011
    Posts
    32
    Vote Rating
    0
    R56 is on a distinguished road

      0  

    Default


    I'm amazed that you keep this kind of huge but simple bugs form your customers.
    Think about it. Most of the great data package is useless in Touch right now, you know it and have the solution but choose to do nothing.
    No offence, you probably know better - just weird.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    We aren't keeping it from you... it will be in the next release.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User R56's Avatar
    Join Date
    Mar 2011
    Posts
    32
    Vote Rating
    0
    R56 is on a distinguished road

      0  

    Default


    How's that not keeping it from me? Do I have any way to access it?
    Sure it will be in the next release, but it's been in the next release for 2 months now. Meanwhile developers who are choosing the framework for their "million dollar" projects(, maybe are familiar with ExtJS) and try out the Touch 2 will be disappointed and never look back to Sencha again, although you may have, and I know you do, some other really good products.
    Ok, it's publicly announced that it's just a dev. preview, but if you have such an amount of bugs in there you can't really test it either. I can't. We would've started our next project with Touch probably, but definitely not Touch 1.1, because all of us are done some work with Ext4 or at least know what it is capable of and love the data and class packages. I and a fellow in the team started to test this out, but came to this problem... You have the fix already so there's no point of digging in the source code to fix the whole thing, but we can't continue either and not just because we have no idea when the next release is coming.
    Touch 2 will be opensource and free, am I right? You can go either way I suppose, but if this is the case there's no point of releasing quarterly, just but your code up to github or something. Everybody could benefit from this, especially the development team of Touch.
    Just something to think about for whoever runs these projects and makes the calls.

    Best regards,
    Rauno

  6. #6
    Sencha User
    Join Date
    May 2010
    Posts
    2
    Vote Rating
    0
    sctteea is on a distinguished road

      0  

    Default


    R56,

    While I share in your frustration when hitting this error, this is a "preview" release, not even Beta. The whole point of a preview is that you are able to start learning how it works instead of having to wait until it is released. Therefor you shouldn't expect a glitch free experience. If you are going to start a "million dollar project" as you call it, you should probably use the last official release even if it differs from Ext4.

    If you are going to start a project based on a preview release (as I did as well), you better go into it expecting there to be problems. If you don't want to wait for the next release to fix a bug, and its a "huge but simple bug", then get your hands dirty and come up with a patch. By doing this you learn even more about the system.

    Anyhow, these overrides worked for me to get past this problem while using localstorage:

    Code:
    Ext.data.proxy.WebStorage.override({    
            getIds: function() {
            var ids    = (this.getStorageObject().getItem(this.id) || "").split(","),
                length = ids.length,
                i;
                
            for(x=0;x<ids.length;x++){
                if (!isNaN(parseFloat(ids[x]))){
                    ids[x] = parseFloat(ids[x]);
                }
            }
            
            if (length == 1 && ids[0] === "") {
                ids = [];
            }
    
    
            return ids;
        }
    });
    
    
    Ext.data.proxy.Proxy.override({
        batch: function(operations, listeners) {
            var me = this,
                batch = Ext.create('Ext.data.Batch', {
                    proxy: me,
                    listeners: listeners || {}
                }),
                useBatch = me.batchActions,
                records;
                
            batch.proxy = me;
            
            Ext.each(me.batchOrder.split(','), function(action) {
                records = operations[action];
                if (records) {
                    if (useBatch) {
                        batch.add(Ext.create('Ext.data.Operation', {
                            action: action,
                            records: records
                        }));
                    } else {
                        Ext.each(records, function(record) {
                            batch.add(Ext.create('Ext.data.Operation', {
                                action : action,
                                records: [record]
                            }));
                        });
                    }
                }
            }, me);
    
    
            batch.start();
            return batch;
        }    
    });
    Hope that helps,
    Scott

  7. #7
    Sencha User R56's Avatar
    Join Date
    Mar 2011
    Posts
    32
    Vote Rating
    0
    R56 is on a distinguished road

      0  

    Default


    Thank you very much, Scott.
    Like I said, my project isn't much, discard it. I expect to have problems but often not as trivial. I'm just surprised how they, being a team of professionals, are able to screw it up continuously and, apparently, deal with this the way they are.
    Again, thank you for the first understanding, useful and non-ranting post in this thread, and good luck in your project.

  8. #8
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I think you are being a little dramatic. PR stages are meant to get it out to people to get their thoughts and see the direction that we are going. PR stages should be thought of as an alpha stage which you should expect to be a bumpy road. We aren't the only company to only do releases, in fact, lots and lots of companies do that so I'm not sure why you think Sencha is unique. So what you would like is for us not to release until beta and skip the PR stage? So you would be waiting until the product is more stabile but knowing that we are working on it? If so, we didn't make you download ST2 yet.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 2