{ "id": "153015", "key": "ALOY-1328", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2015-11-12T08:52:57.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "updated": "2015-11-20T20:00:01.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "13605", "name": "Models" }, { "id": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "We should think about how we can refactor data-binding to be more efficient.\r\n\r\n*Current situation*\r\n\r\n* We add a single event listener to the collections {{fetch destroy change add remove reset}} events.\r\n* The event listener always regenerates the views for all models, remove the existing children and adds the newly generated views (for ListViews and some others it just overwrites).\r\n\r\n*Problems*\r\n\r\nEven if just a single attribute of a single model is changed:\r\n\r\n* It uses a lot of memory.\r\n* It crosses the bridge a lot of times.\r\n* It takes a long time as collections become bigger and the bound views more complex.\r\n* Resetting all children causes flickering and scroll position is lost.\r\n\r\n*Desired situation*\r\n\r\n* For the {{add}} event, only child views for the added model(s) are generated and added to the parent.\r\n* For the {{change}} event, child views for just the changed model(s) are regenerated and the old ones replaced under the parent.\r\n** Yes, it would be even better if we could just change the child view of the model *attribute* that was changed, but I don't think the complexity of the logic is worth going that far.\r\n* For the {{destroy}} and {{remove}} events, only child views for the destroyed model(s) are removed from the parent.", "attachment": [], "flagged": false, "summary": "Refactor data-binding to be incremental rather then reset", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [ { "id": "116461", "key": "ALOY-722", "fields": { "summary": "ScrollableView is automatically repositioning itself to currentPage=0 when Alloy Model updates", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } ], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": null, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }