19 Dec 2012 7:32 AM #1
Component based Dataview and wrapping of items
I am playing around with a component based Dataview that uses buttons for the component type.
What I would like to achieve is to have the buttons flow left to right across the screen and to wrap onto new rows no matter how many records are in the store.
So for example, I have 5 records, and I set the width of DataItem to 50%. I would like for the Dataview to display 2 buttons, followed by 2 buttons below on a second row and then the 5th button on a final third row.
I would imagine I need to do this via CSS, but am unsure how best to proceed.
Can anyone help please?
21 Dec 2012 8:12 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
display: inline-block and some width on the components may do the trick.
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
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 email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
22 Dec 2012 4:01 AM #3
Have a look here
Take a look at the CSS in the example here:
You could just make the padding a bit bigger and it should do what you want