SitePen / dgrid

A lightweight, mobile-ready, data-driven, modular grid widget designed for use with dstore
http://dgrid.io/
Other
628 stars 298 forks source link

Horizontal OnDemandList - Issues with Lazy Loading #890

Open hiteshsjoshi opened 10 years ago

hiteshsjoshi commented 10 years ago

In our project, we extend OnDemandList, Selection and Keyboard to render grid from left to right (instead of top to bottom). We used renderRow to render dgrid-row-elements next to each other. CSS of container div allows grid elements to display as Carousel.

But, seems, OnDemandList is written keeping in mind the conventional top-to-bottom grid. As a result, lazy loading fails and all dgrid-row-elements are created in the startup itself.

I made an attempt to write a new OnDemandHorizontalList which works on the same logic as OnDemandList with the following differences:

offsetTop in OnDemandList is referenced as offsetLeft offsetHeight in OnDemandList is referenced as offsetWidth

Post the change, I do get minRowsPerPage number of dgrid-row-elements at the start, but my preloadNode top does not get updated with correct offsetHeight, offsetLeft and offsetTop values resulting in processScroll thinking that all preload nodes are not currently connected.

Have attached my version of OnDemandHorizontalList (seems, JS file attachment is not allowed, can send the same by mail if required)

Would appreciate any help.

Thanks, Joshi

cogentParadigm commented 6 years ago

Did you ever get this working? I would be interested in seeing this if you've still got it. I have a similar use case I would like to achieve.