You found a bug! We've classified it as EXTJS-5686 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    200
    Vote Rating
    4
    dedoz is on a distinguished road

      0  

    Default [4.1-RC1] HasOne association docs and implementation problems

    [4.1-RC1] HasOne association docs and implementation problems


    (Sorry for my bad english)
    Ext version tested:
    ExtJs 4.1 beta 1, beta 2 , beta 3, RC1

    Browser versions tested against:
    Firefox 10.0.2
    Chrome 17.0.963.66

    Description:
    - HasOne docs problem.
    just check RC1 docs (not online docs) even when applies since 4.1 beta.
    hasOne docs are describing the same thing as a belongsTo association. check the docs for both associations and ull see they are describing the same thing.

    hasOne is not the same as belongsTo.
    hasOne rc1 docs says "The owner model is expected to have a foreign key which references the primary key of the associated model"
    and should say "The associated model is expected to have a foreign key which references the primary key of the owner model"
    if this needs more detailed explanation just tell and ill explain but i think anyone that knows bout associations will understand this.
    their diference is "where the foreign key is placed".
    and anyway current hasOne is describing the same as belongsTo so if that were correct not point to have a hasOne association.

    this correction is important because helps to understand what its implemented.

    i posted this before in
    http://www.sencha.com/forum/showthread.php?184161-Working-with-associated-models-3-hasOne-conceptual-(docs)-problems

    besides that, the example was fixed in rc1, but still is wrong, the foreign key is bad placed (is placed as a belongsTo association)
    foreign key should be placed in the address model of the example.
    detailed explanation here (but this post is old and didnt know bout rc1 lil fix, but still applies)
    http://www.sencha.com/forum/showthread.php?184162-Working-with-associated-models-4-hasOne-conceptual-(docs)-problem-2

    - hasOne source code problem
    setter is doing the same thing as belongsTo does, i guess because is trying to implement what docs says, but after you check docs are wrong then the implementation needs to change.

    setter is setting a misplaced foreignKey, and getter does the same thing.
    it explained here, it was posted for beta3 but still applies for RC1
    http://www.sencha.com/forum/showthre...setter-problem

    please read those posts they are detailed and posted fixs for the implementation.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,672
    Vote Rating
    747
    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 will fix the documentation up
    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
    Join Date
    Dec 2011
    Posts
    200
    Vote Rating
    4
    dedoz is on a distinguished road

      0  

    Default


    but its not just the documentation, and documentation actually is not the important part, doesnt matter is docs are wrong if code works fine, hasOne source code is doing what a belongsTo has to do, hasOne is not really implemented.

  4. #4
    Sencha User SunboX's Avatar
    Join Date
    Mar 2010
    Posts
    239
    Vote Rating
    27
    SunboX will become famous soon enough SunboX will become famous soon enough

      0  

    Default


    +1 for "hasOne" ... it´s more clear than "belongsTo"

  5. #5
    Sencha User
    Join Date
    Jan 2013
    Posts
    1
    Vote Rating
    0
    kiczor is on a distinguished road

      0  

    Default


    So the problem between hasOne and belongsTo will not be resolved? I think dedoz has a point. At this point hasOne and belongsTo are the same, but they should differ and their docs should be updated accordingly. And there is matter of wheter to use hasOne or use hasMany istead?

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,672
    Vote Rating
    747
    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


    Quote Originally Posted by kiczor View Post
    So the problem between hasOne and belongsTo will not be resolved?
    This bug is still open so there is no reason to question if it will be resolved or not. If it was closed then I would question that.
    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.

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