function updateModelFrom(model, data) { // TODO: This is very naive at the moment, we should do proper remove(), // move(), set() and insert() calls, so that the UI can animate changes. for (var i=0; i data.length) { model.remove(model.count-1); } model.sync(); } function updateModelWith(model, key, value, update) { for (var row=0; row