Answered by:
How make different template in same ListView control?

Question
-
I want to know how make different template in same ListView control?
I use javascript language.
thanks!Saturday, September 22, 2012 8:32 AM
Answers
-
Again, you have the sample in hand already; anything I could post here would come from that so you should walk through it in the debugger to really understand it. Again, Chapter 5 of my book walks through this. Specifically see the section entitled "Layouts and Cell Spanning" on pages 202-208.Tuesday, September 25, 2012 6:34 PM
All replies
-
Hi
Please refer to this discussion,
It will show you how to create a inner Listview.
Sunday, September 23, 2012 1:57 PM -
I want to like this:
thanks!
Monday, September 24, 2012 1:56 AM -
You want to use cell spanning (listview inside listview gets more complicated than you need). See Chapter 5 of my book for all the details, download (free) at http://blogs.msdn.com/b/microsoft_press/archive/2012/08/20/free-ebook-programming-windows-8-apps-with-html-css-and-javascript-second-preview.aspx. I have much more in there on this subject than the documentation, and draw from the samples that cover this. Specifically see HTML ListView essentials sample.
.Kraig
Monday, September 24, 2012 5:15 AM -
Can you give an example?
thanks!
Monday, September 24, 2012 6:09 AM -
Not directly in this thread. Please download the SDK sample and examine its code for details; again, Chapter 5 of my book provide more explanation. It's too much to extract here.
.Kraig
Monday, September 24, 2012 7:10 AM -
SDK sample I have watch, but I don't find fit me.
you can which is the example of the specified, thanks!
Monday, September 24, 2012 7:51 AM -
Hi
You can refer to this sample:
HTML ListView item templates sample
For more information you can read Kraig's book Page 203.
A very nice book :) .
Monday, September 24, 2012 9:25 AM -
but this is only change template's size, I want to show different content in different template.
like this:
thanks!
- Edited by hot_blood2001 Tuesday, September 25, 2012 2:23 AM
Tuesday, September 25, 2012 2:22 AM -
The same sample shows how to do that. You'll be using a template function rather than a declarative one. At runtime, that function examples the data item its asked to render and sets the size of the item accordingly. Please spend some time looking at the same and understand what it's doing because it's all there.
Tuesday, September 25, 2012 3:23 AM -
I still do not, can you give me a short sample?
thanks!
Tuesday, September 25, 2012 6:41 AM -
Again, you have the sample in hand already; anything I could post here would come from that so you should walk through it in the debugger to really understand it. Again, Chapter 5 of my book walks through this. Specifically see the section entitled "Layouts and Cell Spanning" on pages 202-208.Tuesday, September 25, 2012 6:34 PM