-
9 Jul 2012 11:15 AM #1
Answered: How to make a list with multiple column in each row in Sencha touch?
Answered: How to make a list with multiple column in each row in Sencha touch?
I want a list with multiple columns in each row. The row also can consist the image. I am able to get the values from store. But unable to display them in a proper way. i need the view something like below: textimage.PNGLast edited by arindam.hit; 10 Jul 2012 at 2:39 AM. Reason: image change
-
Best Answer Posted by jerome76
Take a look at the Tweet example.
Here is the css styling they use:
Here is how they use it in the itemTpl:Code:.tweet-wrapper { h2 { font-weight: bold; padding-bottom: 3px; } img { border-radius: 5px; float: left; } .tweet { font-size: 70%; margin-left: 60px; min-height: 50px; } }
Hope this helps. It did for meCode:itemTpl: Ext.create( 'Ext.XTemplate', '<div class="tweet-wrapper">', ' <img src="{profile_image_url}" />', ' <div class="tweet">', ' <h2>{from_user}</h2>', ' <p>{text}</p>', ' </div>', '</div>',
-
9 Jul 2012 11:27 AM #2
You can do this all with the itemTpl and proper html/css styling.
For example:
itemTpl : '<div style="font-size: 0.9">{fileName}</div><div style="font-size: 0.8em">{someOtherInfo}<br/></div><div style="font-size: 0.7em">{yetMoreInfoOnA3rdLineEvenSmaller}</div>'
-
9 Jul 2012 11:30 AM #3
Ok, i will try..
-
10 Jul 2012 2:43 AM #4
i tried with the below code:
But it is showing on after another vertically..Code:itemTpl: Ext.create('Ext.XTemplate', '<div style="font-size: 1">{firstName}</div><div style="font-size: 1">{lastName}<br/></div><div style="font-size: 1">{heading}</div>' )
-
10 Jul 2012 7:39 AM #5
You shouldn't need all those divs if they are producing the same style.
And what do you mean it is showing on[e] after another vertically?Code:... itemTpl: new Ext.XTemplate( '<div style="font-size: 1">{firstName}<br />{lastName}<br/>{heading}</div>' ) ...
You are adding in <br /> which creates a line break in the html so they would be on separate lines.
I'd like to see an image of what it is producing for you.
-
10 Jul 2012 7:50 AM #6
Styling is not my strong suit but I know you can format anything you want in the list. That line was taken directly from my code with just the field names changed. Try it with a very simple List first and work up to the one with the images.
-
10 Jul 2012 7:58 AM #7
Take a look at the Tweet example.
Here is the css styling they use:
Here is how they use it in the itemTpl:Code:.tweet-wrapper { h2 { font-weight: bold; padding-bottom: 3px; } img { border-radius: 5px; float: left; } .tweet { font-size: 70%; margin-left: 60px; min-height: 50px; } }
Hope this helps. It did for meCode:itemTpl: Ext.create( 'Ext.XTemplate', '<div class="tweet-wrapper">', ' <img src="{profile_image_url}" />', ' <div class="tweet">', ' <h2>{from_user}</h2>', ' <p>{text}</p>', ' </div>', '</div>',



Reply With Quote