PDA

View Full Version : Complex component DataView with multi-part DataItems



zigguratt
17 Apr 2012, 5:36 AM
Hi all,

I'm still finding my way with Sencha Touch and have come across a situation where the solution is not obvious to me. I'm designing an electronic program guide (EPG), but of course I want to make it slightly more complex than your standard EPG.

The EPG will still be a grid of shows with the the x-axis representing blocks of time and the y-axis the channels. The difference will be that you can swipe through time on individual channels as opposed to the whole EPG scrolling left or right.

As far as I can tell, I need a component DataView with compound DataItems. Each row will consist of a container and a carousel. The container will be on the left and will display the channel number, call letters and logo. To its right will be a carousel of time blocks and details of the shows on that channel in each time block. This will be repeated vertically for every channel in the database.

I've looked at the (very few) examples of a component-based DataView but it looks like each DataItem can only use one store. I need to access two: one for the channel information and one for the show details. How would I best set this up to achieve the functionality I described above?

mitchellsimoens
17 Apr 2012, 6:35 AM
The 2nd store be used for the carousel?

zigguratt
17 Apr 2012, 6:47 AM
The 2nd store be used for the carousel?
Yes. I don't want to mix the channel information in with the show details. I'm using a hasMany association on the channels for the shows. Because of this bug (http://www.sencha.com/forum/showthread.php?195371-autloaded-associations-don-t-properly-filter-data-from-a-JSON-proxy) I'll have to fake the relationships for now, but eventually it'll use a database with these associations.

mitchellsimoens
17 Apr 2012, 7:15 AM
I don't think that you will have access to the record when the apply method for the component is created making it very hard to get the hasMany store for the store.

zigguratt
17 Apr 2012, 7:49 AM
That's somewhat disappointing. I know it's a bit more complex than a standard list in a carousel, but I would think it isn't that uncommon a use case.

Is this a situation where I would have to create my own component? I know you did so for your ST2 grid component, but the process seems quite involved. I don't have the time to get that familiar with ST2 for this proof of concept.