18 Apr 2013 1:31 AM #11
You should not need the item index in component and ... you should not make a component dependent of its parents normally. It's some how against the intention of mvc. How so ever you can use up() to get the DataItem container as well as the DataView itself so having these references and the actual data item you can easily get the item index:
18 Apr 2013 7:25 PM #12
thank you for the "getItemIndex" clue been looking for such a thing and could not find it yesterday instead i have to do merry go around with getting the store first then get the item index on the store and save it as the item index.
the get itemIndex is without doubt is the much simpler way of getting the item index ( i need the item index in order to pass it to other modules of this app its been there before i got involved and will be needing a lot of effort if i want to change that so i'll just use it as it is)
that is a good point about not making the child component dependent of the parent, will definitely mark this in my brain so i will not easily do this kind of stuff again in the future..
thank you bluehipy for your guidance it definitely helped me!
*just being curious though from where do you learn sencha touc
18 Apr 2013 10:20 PM #13
In child components you could fire events that you can catch later on parent containers, this way you can keep them independent.
I had a great teacher, I am self taught
Mainly I have read all docs + tutorials + watched videos:
also I am constantly checking sources for everything from Ext.Base ~ Ext.Component to Ext.dataview.Dataview, layouts, models, proxies, stores etc
and intensively worked on projects based on st1, st2.0 ~ st2.1 for the last years
18 Apr 2013 11:33 PM #14
19 Apr 2013 12:34 AM #15
Thanks =NR=, you 're cool