airbnb / infinity

UITableViews for the web (DEPRECATED)
http://airbnb.io/infinity/
Other
2.8k stars 281 forks source link

add multi items append and element scroll support #19

Closed ozzysun closed 11 years ago

ozzysun commented 11 years ago

add appendArray function to append multi items and add support element scroll i have write simple example code in wiki

reissbaker commented 11 years ago

Hm. I think these two features should definitely be in separate pull requests.

Resetting $window to a different element will break pages with multiple ListViews on them (i.e., column-based layouts where each column is a ListView), if some of the ListViews need element scrolling and some don't.

I'm not sure what the appendArray function is doing, or why it needs so much state. append could be modified to accept arrays and wouldn't require any extra state being kept in the ListViews or Pages, by typechecking the input value and recursively calling itself on each item when given arrays.

ozzysun commented 11 years ago

Hi.When I use append to add items to page it will append items DOM to page immediately if have many many items,it may need a little time to wait.

So I use appendArray Jsut keep items html string in page object but not append DOM to Page till updateStartIndex have been fired will append html to page and create items DOM