I’m building a website to take into account the device size. I’m using CSS3′s @media tag to change the webpages appropriately as the viewport size changes. I also have a listview control to display products. I would like to be able to dynamically set
the number of items per page and the number of items in each group as the viewport changes. Is this possible?
see this building windows 8 blog post…
- all done client side with css 3 and html5
I would argue that the exception is Smart Phones where you need a completely different site navigation pattern and layout targeted to a 320px by 480px screen size and scaled to 1.
see m.bing.com or m.seek.com.au – mobile optimized sites that don’t use server side UAS sniffing.
aslo see this excellent article
of the layout types discussed there are two versions… fixed and fluid… only a fluid layout will scale to fit all screen sizes…. you adjust the scaling in a device viewing a web page with the viewport meta tag….and using the HTML5 document type declaration.
The size is not sent to the server, you could sniff the nrowser type on the server and send down different pages. Plenty of code examples on the net available for that.
I totally agree with Eric. An (not so easy) approach would be to create a flexible layout (because of line breakings) and let the user choose how many entries he would like to see on one page (like you see on many sites).
I’m sorry. Due to illness in the family I had to put this aside for awhile.
I do have a fluid layout, and I can certainly let the user select how many items to display, but this is where I run into a problem.
I’m using a listview control. At the moment I have it set to dsiplay three records across. However I’d like to let the listview display however many records across it can handle. I can easily do this with CSS. My problem is I think it looks bad to allow
say, 10 records per page, and display 4 records across. You get three rows of 4, 4, and 2 records on every page but the last. I’m looking for a way to update my datapager server side so that each row of each page is full, as long as I have enough records.