javascript - Infinite scroll js with backbone -
I am constantly stuck with this issue for 3 days, I used to scroll in my spine project I am trying.
I tried to find an answer to my question with the search engine but I was unable to do this, I am the initiator developer with View item list: View of item list views: Item collection: And I divided the item list and item template into separate HTML files. Item list template: item template: I wonder, do I have to add more to the collection, or how to scroll Separate complete data in small size I'm sorry if I'm a little late! Welcome to your question and thank you for any help with my problem, you can provide me! This time you renders everything itemView.render (), accept it index parameters, and share the archive Then your plug-in should be rendered }); backbone.js .
var ItemList = Backbone.View.extend ({initialize: Function () {}, render: function () {this. $ El .empty (); this.collection.each (function (_itemData) {var itemList = new item view ({model: _itemData}); $ .append (itemList.el);}, this);}}) ;
render: function () {var _itemList = _template (ItemListTem); . This $ el.html (_itemList); Var _itemObj = Find _item.getItem (this.options.key); Var itemcallions = new item collection (_itemObj); Var itemListView = new item list ({archive: item collation, L: '.itemListContainer'}); ItemListView.render (); });
var itemCollection = backbone.collection.extend ({Model: itemModel, url: RootWebsite});
& lt; Div class = "itemListContainer" & gt; & Lt; / Div & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ ('#empan itam'). Infinitiuscroll ({navSelector: "#next: last", next selector: "one # next: last", item selector: "#appendItem p "Debug: True, loading IMG:" / img / loading .gif ", loading text:" Loading new post ... ", animate: right, donation:" I think we reach the end Gone ", adend callback: wrong, path: [" http: // localhost / website / # itemlist "]}, function (jason, ops) {var page = opts.state.currPage;})}}; & lt ; / Script & gt;
console.log (opts.scur.currPage) Page no. 1,2,3 Increase ... when scrolling arrives at the corner of windows and it has no effect on the list of my view.
Render: function (index) {//this.$el.empty (); Var Load Elements = Index * 10; _ (This.collection.models.splice (Load Elements, Load Elements +10)) each (function (_itemData) {var itemList = new item view ({model: _itemData}); $. El.append (itemList.el ); },this); }
}, function (Jason, Opts) {var page = opts.state.currPage; ListView.render (page-1) // You said that it starts with 1});
Comments
Post a Comment