Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Oct 2010
    Posts
    39
    Vote Rating
    0
    ashapiro75 is on a distinguished road

      0  

    Default Models, Stores, Associations and Filters

    Models, Stores, Associations and Filters


    I'm not sure if this should be in Architect or in Sencha Touch 2 but I have a question in regards to best methodology around stores and models.

    Say I have 4 stores :

    1) Model
    2) Type
    3) Color
    4) Items

    Store 4, Items is all the combinations that exist of stores 1, 2,3.

    I have 3 selectors on a page, 1 for stores Model, Type, Color.

    What I want to do is filter down store 4 based on my selections from stores 1,2,3. However I also want to filter selectors, 2 and 3 based on selections from selectors 1, 2.

    Use Case,
    I select a model, then I want the next selector to return the distinct types related to that model.
    After I select a type, I want to return the available color selections for that Model / Type combination.

    Then after I make a color selection, I want to return the available items that match my 3 selectors.

    I know how to do this in SQL with a flat table, I also know how to do it in SQL with a relational setup and foreign keys, joins, etc...

    I could put the functionality into a handler page / api but then my app will only work if I am connected to the internet and I can make the calls necessary to re-pop my stores.

    I've read through the documentation on Data, Models, Stores, filters and associations and I've looked at the the videos but I still don't get how I would achieve this with these items.

    Would I use 1 store? Would I use 4 Stores? Would I need a cross store like a cross table? Is there a way to query a store for "distinct" results? Then I can use 1 flat store that has all my combinations in it and just select distinct models, types, colors and then filter the single store based on filters for model, types, colors. This seems like it would be the easiest method with the least amount of overhead.

    Models can have Many Types
    Types can have Many Models
    Types can have Many colors
    Models can have Many colors
    Colors can have many types
    Colors can have many models

    Each selection combination could have many items.

    The easy way for me to do this would be to create a handler page that functioned as an API. This would be the URL I would use in my proxies. I would make my three selections, pass the values to my handler, that would query my database and return the records in Json format for me. This is the easy way for ME to do it but like I said, it makes my app require an online connection.

    My app will need to function like this -
    Start-up,
    Check for connection, if no connection, use data that's stored locally. If there is a connection, check data source to see if data was updated, if it was updated, download and update local data.

    Then everything beyond that should be driven off of the locally stored data.

    So would I use 1 store, with many models? A model for Models, Types, Colors and Items? Then use an Association between the models?

    I don't understand what the benefit of using associations is?


    Thanks in advance for anyone who can help me figure out the Best Practices for this.

  2. #2
    Sencha - Architect Dev Team jjohnston's Avatar
    Join Date
    Sep 2010
    Posts
    459
    Vote Rating
    15
    jjohnston will become famous soon enough jjohnston will become famous soon enough

      0  

    Default


    Sounds like a very interesting problem to solve!

    Definitely not trying to blow you off, but you're much more likely to get an informed answer/discussion in the Sencha Touch 2 discussion forums. The approach you take will likely be the same whether you're using Architect to put it all together or not. If you run into issues implementing your decided approach in Architect definitely come back and post here.
    Jason Johnston
    @lojjic
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Oct 2010
    Posts
    39
    Vote Rating
    0
    ashapiro75 is on a distinguished road

      0  

    Default


    Thanks, I will move it over there!

Thread Participants: 1