Lazy Load Nested DataLists when scroll position changes

O

Ole V.-M.

Greetings,

i have a UserControl, that contains a DataList. That DataList contains
as items other DataLists.

example:

DataList A Row 1
Nested DataList 1
Row 1
Row 2
Row 3
DataList A Row 2
Nested DataList 2
Row 1
Row 2
Row 3

DataList A is populated with a list of Categories, and the "Sub-
DataLists" are assigned a DataTable that contains a list of products
for the category, the "Parent-DataList" is assigned to.

The subdatalists are created dynamically by assigning a DataTable to
the DataSource-Property of DataList A:
DataSource='<%# GetDataSource(Container.DataItem("CategoryID"))%>'

The problem with this scenario is, that the amount of data is very
large and the product lists contain pictures, so that the whole page
needs too much time to load.

What i want to do now, is to bind the "sub-datalists" only when the
user scrolls to the sub-datalists location. PageFlow is no option,
since all products have to be visible.

How can i accomplish this? I realize i have to implement some kind of
javascript functionality or Ajax enable this control. But how do i
assign the datasources to the subdatalists and bind them from
clientside when the subdatalist is scrolled to.

Any suggestions appreciated.

Thanks in advance
Ole
 
O

Ole V.-M.

in my last post, there's a little error
The subdatalists are created dynamically by assigning a DataTable to
the DataSource-Property of DataList A:
DataSource='<%# GetDataSource(Container.DataItem("CategoryID"))%>'

It has to be:

The subdatalists are created dynamically by assigning a DataTable to
the DataSource-Property of the Sub-DataList:

DataSource='<%# GetDataSource(Container.DataItem("CategoryID"))%>'
 
O

Ole V.-M.

I'll try to do it like this:

I'll Define javascript functions that fetch xml data from the
webserver on demand, that is processed and transformed using xsl/xslt.
Demand occurs, when a user scrolls the document and the current
viewspace of the browser contains the subdatalist that is to be
displayed.

Post any comments or suggestions on how to improve what i am planning
to do, if you like.

with regards
ole
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top