Search Results

Search found 2 results on 1 pages for 'ksol'.

Page 1/1 | 1 

  • lots of backbone views - performance issues?

    - by ksol
    tl;dr: I wonder if having lots (100+ for the moment, potentially up to 1000/2000 or more) of backbone views (as a cell of a table) is too heavy or not The project I'm working on revolves around a planning view. There one row per user that covers 6 hours of a day, each hour splitted in 4 slots of 15mn. This planning is used to add "reservations" when clicking on a slot, and should handle hovering of the correct slots, and also handle when it is NOT possible to make a reservation - ie. prevent user click on an "unavailable" slot. There is many reasons why a slot can't be clicked on: the user is not available at this time, or the user is in a reservation; or the app needs to "force" a delay slot between two reservations. Reservations (a div) are rendered in a slot (a cell of a table), and by toying with dimensions, hovers the right number of slots. All this screen is handled with backbone. So For each slot I'm hovering on, I need to check wether I can do a reservation here or not. As of this moment, I use this by toying with the data attributes on the slots : when a reservation object is added, the slots covered are "enhanced with (among others) the reservation object (the backbone view object). But in some cases I don't quite have a grasp on now, it mixes up, and when the reservation view is removed, the slots are not "cleaned up" : the previous class is not reset correctly. It is probably something I've done wrong or badly, but this is only going to get heavier; I think I should use another class of Backbone views here, but I'm afraid the number of slots and thereof of views objects will be high and cause performance issue. I don't know mush about js perf so I'd like to have some feedback before jumping on that train. Any other advice on how to do this would be quite welcomed too. Thanks for your time. If this is not clear enough, tell me, I'll try and rephrase it.

    Read the article

  • Backbone: rendering syntax

    - by ksol
    We're using Backbone.js in one of my team's projects, and this is the first time I use it. I've seen many times this kind of code (it's coffeescript, but clear enough I think. @ means this.) clients_view = new Homespa.Views.Orders.Clients.SectionView(collection: @options.clients) @$("#clients-section").html(clients_view.render().el) clients_search_view = new Homespa.Views.Orders.Clients.SearchView @$("#clients_search_modal").html(clients_search_view.render().el) Isn't there a better way to do this? I would expect to just call render on my view, and then everything's good, I shouldn't have to get the html and append/replace it by hand. Thanks for you time !

    Read the article

1