Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 37

Thread: Ext4 data package and overall quality

  1. #11
    Sencha User KJedi's Avatar
    Join Date
    Feb 2008
    Location
    Ukraine, Mykolayiv
    Posts
    145

    Default

    Brian,

    Initial purpose of the post was to explain my thoughts over the latest trends in sencha and offer our help to bring up the data package to the usable condition quickly.

    Everyone replied everything but this.

  2. #12
    Sencha User dorgan's Avatar
    Join Date
    Dec 2007
    Location
    Cocoa, FL
    Posts
    286

    Default

    I am sure there is someone out there that when they have time will give you the response you are looking for. Please do keep in mind though that the data package does work...as I am using it in a ExtJS4 project and I believe there are probably others that are using it and it works. So just be patient for the right person to respond...

  3. #13
    Sencha User KJedi's Avatar
    Join Date
    Feb 2008
    Location
    Ukraine, Mykolayiv
    Posts
    145

    Default

    Maybe you can explain as a user of a working data package how can I have a store with models Order and another store with models User. Each user has several orders.
    I want to load store with orders and the access user for this order by relation (association). How is it possible in so-called working data package?

    Sorry for irony, I just think that even if it is working, it is working for a limited number of uses which makes it useless in the big app.

  4. #14
    Sencha User edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939

    Default

    I'll try to address these in order:

    Quote Originally Posted by KJedi View Post
    1) Why in the nested loading examples you have examples minified? Isn't it because they are fake?
    I can explain why I think this.
    Go to this page:http://dev.sencha.com/deploy/ext-4.0...d-loading.html
    See, everything is working nice and example is supposed to show how cool the sencha data package is. But let's look closer. In chrome console type Ext.StoreManager. You can see the object. Now let's delete Ext.StoreManager.items[1]. We can just set it to null. Application continues working! However it should not because we've just removed the whole store with reviews. Hm... let's examine the contents of the Ext.StoreManager.items[0]. Aha, for each book we have additional property "reviews" which contains the data. Why it is there? Why there is a data duplication? What is the purpose of the store with reviews if no data is taken from there? What is the purpose of having several models in the same store? No ORM does this. One model = one collection. If ExtJS allows having several models in one store, that is cool, but it should not MAKE us use it like this.
    JavaScript doesn't work like that. Setting Ext.StoreManager.items[1] = null simply removes the reference to that Store from the StoreManager. It doesn't otherwise affect the Store at all, and certainly doesn't delete it and its reviews. While I can see you are frustrated, accusing the example of being a "fake" when you don't have a clear understanding of the language itself is not the best way of getting helpful feedback.

    You're right about it being minified though - we do this to make the example load faster and to demonstrate the automatic builder tool, but perhaps we also confuse people with this.

    Quote Originally Posted by KJedi View Post
    2) What is associationName, instanceName and name? How should we use it? Why there is nothing in the docs about it?
    http://docs.sencha.com/ext-js/4-0/#/...anyAssociation has both an overview and an item by item description of the configurations. If there's not enough detail there let us know how we can improve.

    Quote Originally Posted by KJedi View Post
    Animal
    3) More specific question. On this page: http://docs.sencha.com/ext-js/4-0/#/...sToAssociation we can see the example for the foreignKey property:
    Code:
    Ext.define('Order', {
        extend: 'Ext.data.Model',
        fields: ['id', 'date'],
        hasMany: 'Product'
    });
    
    Ext.define('Product', {
        extend: 'Ext.data.Model',
        fields: ['id', 'name', 'order_id'], // refers to the id of the order that this product belongs to
        belongsTo: 'Group'
    });
    var product = new Product({
        id: 1,
        name: 'Product 1',
        order_id: 22
    }, 1);
    product.getOrder(); // Will make a call to the server asking for order_id 22
    However if you run the example, product.getOrder === undefined!
    I don't know how the problem can be more specific than not working examples in the docs!

    I can provide more examples of strange things not to say "bugs" that should be addressed.
    You are defining two models - Order and Product, but in your Product model you say it belongsTo Group, which is not one of your models. The getOrder function is created dynamically when you create the association to the Order model, which you did not do. Does this make sense?

    Quote Originally Posted by KJedi View Post
    Again, I don't say that everything is wrong. I say that data package (and I guess not only this part) is half-finished. Since we need it for our work, we can help with it's quick development because it is a priority for us.
    I don't think that is true. The new data package has been used in Sencha Touch for close to a year now and has not been significantly modified for Ext JS 4 - it's one of the most mature parts of the new functionality and has lots of real-world testing in hundreds of production apps.
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  5. #15
    Sencha User KJedi's Avatar
    Join Date
    Feb 2008
    Location
    Ukraine, Mykolayiv
    Posts
    145

    Default

    Thank you, Ed.

    This post makes more things clear. However the example from the docs is not still clear yet. If I correct the example and put Order instead of group I still get error:
    TypeError: a is undefined.
    Here's the code:
    Code:
    Ext.define('Order', {
        extend: 'Ext.data.Model',
        fields: ['id', 'date'],
        hasMany: 'Product'
    });
    
    Ext.define('Product', {
        extend: 'Ext.data.Model',
        fields: ['id', 'name', 'order_id'],
        belongsTo: 'Order'
    });
    var product = new Product({
        id: 1,
        name: 'Product 1',
        order_id: 22
    }, 1);
    product.getOrder();
    What is the problem now?

    Also, I still want to know how to approach the problem I outlined in the previous post:
    How can I have a store with models Order and another store with models User. Each user has several orders.
    I want to load store with orders and the access user for this order by relation (association). E.g. write something like orders.getAt(0).getUser().username.
    Data about user should be loaded from the server. How is this possible?

  6. #16
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451

    Default

    Do you have an Orders?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  7. #17
    Sencha User
    Join Date
    Jun 2011
    Location
    Kyiv, Montreal
    Posts
    124

    Default

    hi ed,
    http://docs.sencha.com/ext-js/4-0/#/...anyAssociation has both an overview and an item by item description of the configurations. If there's not enough detail there let us know how we can improve.

    there is no information about instanceName - which (as far as I understand) describes the name of the model field which will hold child model and change it explicitly.



    You're right about it being minified though - we do this to make the example load faster and to demonstrate the automatic builder tool, but perhaps we also confuse people with this.


    Yes you are, it is very difficult to understand how it can works in minified version.



    You are defining two models - Order and Product, but in your Product model you say it belongsTo Group, which is not one of your models. The getOrder function is created dynamically when you create the association to the Order model, which you did not do. Does this make sense?


    I think we should ask you about this, beacause this source is a part from extjs4 docs.



    I don't think that is true. The new data package has been used in Sencha Touch for close to a year now and has not been significantly modified for Ext JS 4 - it's one of the most mature parts of the new functionality and has lots of real-world testing in hundreds of production apps.

    Hmm...., then could you tell me what is this code about:
    // hack to support loadmask
    mask: function() {
    this.masked = true;
    this.fireEvent('beforeload');
    },

    // hack to support loadmask
    unmask: function() {
    if (this.masked) {
    this.fireEvent('load');
    }
    },


    About associations in Extjs 4.
    I develop large web-application in Rails3, and for me, extjs 4 associations are not clear, as I want.

    1. As far as I understand, Store is like a tabe in database,
    so take for example nested-loadind (extjs4 mvc example).

    The question is: why Books store handles all information about reviews, is this correct?
    if it doesn't how does this code work?
    Ext.StoreManager.items[1].removeAll();
    Ext.StoreManager.items[0].getAt(0).reviews() //--> returns new Store, but I have just remove all reviews, or not?

    Looks at server-side,
    In the database I have two tables one for books, another for reviews, they will be linked with book.id and reviews.book_id, when I makes join I received all required data without any problems, now go to the client-side.

    What we are doing here, we should manually load new data to Reviews-store. --- is this you call hasMany-association in extjs4?

    tell me if I am wrong.

  8. #18
    Ext JS Premium Member
    Join Date
    Mar 2010
    Posts
    227

    Default

    I'd like to point any Sencha dev in here to my thread. How could a production release of a grid not a) perform this core function without issues, and b) not be supported by examples and documentation on proper handling of server responses.

    Just paid $600 for a license to ExtJS4 for access to the premium forums. If that doesn't resolve my issue, I will likely drop this library and go elswhere.

    I am not a dilettante downloading a GPL package and going nowhere with it. I have two startups waiting on my decision of which libraries and frameworks to use for large apps that investors are about to pour money into. Lots of licensing fees in play, but something at Sencha seems...I don't know... off. Call it a "managerial smell", if you will. The devs may be working hard; the problem seems not there. IOW, the sum of the hard-working parts is not a great and consistent whole.

    Right now, I am getting more and more reluctant and may call my $600 a loss...

  9. #19
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451

    Default

    Quote Originally Posted by alphadogg View Post
    I'd like to point any Sencha dev in here to my thread. How could a production release of a grid not a) perform this core function without issues, and b) not be supported by examples and documentation on proper handling of server responses.
    Have you posted any bugs in bugs forum or anything in the support portal? I see you said that you just paid for support so I guess you haven't gotten access yet.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  10. #20
    Sencha User edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939

    Default

    Quote Originally Posted by KJedi View Post
    Thank you, Ed.

    This post makes more things clear. However the example from the docs is not still clear yet. If I correct the example and put Order instead of group I still get error:
    TypeError: a is undefined.
    Here's the code:
    Code:
    Ext.define('Order', {
        extend: 'Ext.data.Model',
        fields: ['id', 'date'],
        hasMany: 'Product'
    });
    
    Ext.define('Product', {
        extend: 'Ext.data.Model',
        fields: ['id', 'name', 'order_id'],
        belongsTo: 'Order'
    });
    var product = new Product({
        id: 1,
        name: 'Product 1',
        order_id: 22
    }, 1);
    product.getOrder();
    What is the problem now?
    I copied and pasted your snippet above into the console in an Ext JS 4 app (you can try it be pasting into http://dev.sencha.com/deploy/ext-4.0...ed-viewer.html or any of our other examples). When I run the code I get the following error:

    "You are using a ServerProxy but have not supplied it with a url."

    This might not be as informative as it could in this case but as mentioned frequently in the documentation each Model can be attached to a Proxy in Ext JS 4 to fetch data without a Store. That's the new functionality you're attempting to use above, but you didn't provide a Proxy. The Proxy is what loads and saves the data for your Models - if you look at your snippet above you'll see it doesn't ever tell Order or Product how to load itself.

    Quote Originally Posted by KJedi View Post
    Also, I still want to know how to approach the problem I outlined in the previous post:
    How can I have a store with models Order and another store with models User. Each user has several orders.
    I want to load store with orders and the access user for this order by relation (association). E.g. write something like orders.getAt(0).getUser().username.
    Data about user should be loaded from the server. How is this possible?
    The data package guide (http://docs.sencha.com/ext-js/4-0/#/guide/data) has sections on associations and nested loading and contains far more information than I could provide here.
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

Page 2 of 4 FirstFirst 1234 LastLast

Posting Permissions

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