-
1 Feb 2013 5:19 AM #1
Unanswered: How to get the selected record in dataview based on the target ?
Unanswered: How to get the selected record in dataview based on the target ?
Hi All,
I've a dataview and when that item is tapped, pushing another view based on the selected dataview item record. Now, Assume that, i don't have item tap event. My question is
is there any way to get selected item details ( Like record,selectedIndex, etc. ) only using target, element of the tapped area?
Please suggest me way to achieve this.
Thanks
-
3 Feb 2013 1:43 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
- Answers
- 3102
You can get the index from something like:
Now you got the index you can get the record from the storeCode:dataview.getViewItems().indexOf(target)
Code:store.getAt(index)
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
4 Feb 2013 5:58 AM #3
@mitchellsimoens,
Thanks for the reply. dataview.getViewItems().indexOf(target) is useful,if user taps on dataview item. If any image was written in that template, then it is not able to identify the index of the selected region.
can you suggest update for this?
Thanks.
-
4 Feb 2013 6:14 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
- Answers
- 3102
You need to get the top level div for that row using e.getTarget() if the target isn't what you need.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote