Hybrid View

  1. #1
    Sencha User
    Join Date
    Mar 2008
    Posts
    58
    Vote Rating
    0
    johnstontrav is on a distinguished road

      0  

    Post 1:m association tables

    1:m association tables


    Hi ext'ers!

    Im looking for some ideas on how to handle add/edit forms for 1:many and many:many tables?

    Note the joiner table has fields aswell that need to be filled out, for example:

    [bundles]
    id
    name

    [products]
    id
    name

    [bundles_products]
    id
    bundle_id
    product_id
    price
    start_date
    end_date

    I hope that make sense. Any ideas would be great!!!!

    Thanks
    Trav.

  2. #2
    Ext User
    Join Date
    Apr 2008
    Posts
    418
    Vote Rating
    0
    pokerking400 is on a distinguished road

      0  

    Default


    Table design is wrong...

    Product

    Bundle

    bundle_products should only have two columns
    product_id
    bundle_id


    You can have a view with combination of those two but not a table..

    I am also working on master/detail edit forms...long way to go ...

  3. #3
    Sencha User
    Join Date
    Mar 2008
    Posts
    58
    Vote Rating
    0
    johnstontrav is on a distinguished road

      0  

    Default


    Quote Originally Posted by pokerking400 View Post
    Table design is wrong...

    Product

    Bundle

    bundle_products should only have two columns
    product_id
    bundle_id


    You can have a view with combination of those two but not a table..

    I am also working on master/detail edit forms...long way to go ...
    Hi pokerking400,

    i disagree with you regarding table design. How would you handle (design) an association between 2 tables that exist for a defined period of time?

    In this case the joiner table will need start_date and end_date fields as well as the id fields.

    Im happy to be proven wrong here, but the issue regarding screen design still exists.

    Cheers,
    Trav.

  4. #4
    Ext User
    Join Date
    Apr 2008
    Posts
    418
    Vote Rating
    0
    pokerking400 is on a distinguished road

      0  

    Default


    Price is part of product not the bundle product. Anyway table design is not the issue you are asking here.

    I am also working on master/detail form , so far i am stuck in layout... i am working on dynamic form concept. You can always design manually anyform by specifiying fixed size...but i am trying to create one single form for all types of objects.

    No many to many though...

    It only covers one to one and one to many.

    later,

  5. #5
    Ext User
    Join Date
    Nov 2007
    Posts
    11
    Vote Rating
    0
    thewebguy is on a distinguished road

      0  

    Default


    Quote Originally Posted by pokerking400 View Post
    Price is part of product not the bundle product. Anyway table design is not the issue you are asking here.

    I am also working on master/detail form , so far i am stuck in layout... i am working on dynamic form concept. You can always design manually anyform by specifiying fixed size...but i am trying to create one single form for all types of objects.

    No many to many though...

    It only covers one to one and one to many.

    later,
    No, what he's saying is the price and the dates are properties of the Product Bundle. Price has no concept solely in the context of a product, nor a bundle. If you have a drinks table, and a sizes table, for example:

    [drinks]
    id
    name

    [sizes]
    id
    name

    [drink_sizes]
    drink_id
    size_id
    price

    You can't put a price on just a coke, and you can't put a price on a large, but you can put a price on a large coke.

    Anyway, what I normally do is, for a one-many I simply include a grid in the form that contain many entities belonging to that single entity. If the relationship contains more properties, simply include that as part of adding entities to the form.

    For a many-many, usually you'd have two forms, each with their own mutual editor grids. In your example, I'd have a product form which has a 'select bundles to link' grid, where you chose the bundles, and for each specify a start date, end date, and price for that link. And in the bundle form, you have a 'select products to link' editor grid that has pretty much the same, only for products.

  6. #6