@oscaroxy wrote:
I dowloaded "https://github.com/emberjs/list-view" but I don't understand How I refresh model ... that is, first load of page I have 1000 elements, after (by ajax) I load other elements by filtering so I have 700 elements, how I render this new elements?
Or better if I have 1000 elements and I would filtering this elements in client without call ajax How do I do? My code is:
//create Ember application App = Ember.Application.create(); // define default index route and pushing some data to content App.IndexRoute = Ember.Route.extend({ model: function() {console.log('Ember.Route.extend') var items = []; for (var i = 0; i < 10000; i++) { items.push({id: "item-"+i, name: "Item " + i, isVisible:true, className: (i==10 ? 'row red' : 'row')}); } return items; } }); // extending Ember.ListView // customize the row views by subclassing Ember.ListItemView // and specifying the itemViewClass property in the Ember.ListView definition App.ListView = Ember.ListView.extend({ height: $( window ).height() - 20, rowHeight: 40, itemViewClass: Ember.ListItemView.extend({templateName: "row_item"}) });
thanks
Posts: 1
Participants: 1