-
21 Mar 2012 12:33 AM #1
Answered: How do I make text right below small canvas?
Answered: How do I make text right below small canvas?
This might be a html question, anyway, how can I structure text right under smaller canvas in dataview?
I tried table to have canvas in row 1 and text in row 2, but it spans to the whole width of screen and width attributes is not working... Thanks!
caro.jpg
-
Best Answer Posted by Ethan Long
Managed to do it by this:
itemTpl: '<div class="x-inner" width=220 style="float:left" id="longfan{index}"><img src="{prevUrl}" height="' + 90 + '" width="' + 120 + '" style="padding:5px; margin:' + spacingDistance + 'px; background: white; -webkit-box-shadow: 3px 3px 7px rgba(33,33,33,.7);' + 'border-radius:6px;"></img><div align="center" style="font-size:1.2em;">{name}</div></div>',
-
21 Mar 2012 5:19 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
The <div> wrapping the <canvas> and the <div> wrapping the text, do they have display defined in your CSS? Technically <div>s should stack by default.
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.
-
21 Mar 2012 7:03 PM #3
No css defined for them. I even added <br>, still not working as desired. The text will be lower but still on the right hand side of the canvas.
-
22 Mar 2012 9:35 PM #4
I think the key is how to use 'float', after I remove 'float:left', the text appears under the canvas but each canvas/text takes entire row...
Code:itemTpl: '<canvas height="' + 100 + '" width="' + 200 + '" id="gallery-dwg-#{index}"' + ' style="padding:' + spacingDistance + 'px; margin:' + spacingDistance + 'px; background: white; float: left; -webkit-box-shadow: 3px 3px 7px rgba(33,33,33,.7);' + 'border-radius:4px;"></canvas><div>{name}</div>',
-
25 Mar 2012 9:57 PM #5
Managed to do it by this:
itemTpl: '<div class="x-inner" width=220 style="float:left" id="longfan{index}"><img src="{prevUrl}" height="' + 90 + '" width="' + 120 + '" style="padding:5px; margin:' + spacingDistance + 'px; background: white; -webkit-box-shadow: 3px 3px 7px rgba(33,33,33,.7);' + 'border-radius:6px;"></img><div align="center" style="font-size:1.2em;">{name}</div></div>',


Reply With Quote