dhardin / SP-PermissionManagement

An intuitive way to alter user permissions in SharePoint.
MIT License
10 stars 5 forks source link

Collection should render only 'active' items only #4

Closed dhardin closed 9 years ago

dhardin commented 9 years ago

Currrently, the various library views render all items regardless of their 'active' setting. This really only applies to any item in the dual-select box, but if an item's active property is false, the item is hidden, but still added to the dom. Adding hidden items to the DOM still force the browser to repaint the screen, thus adding overhead.

This can drastically be seen in cases where a user or group only has a few selected items. Instead of rendering 5 items, it may be rendering 150 items, where 145 of them are hidden.

A workarouond may be to set a temporary collection to render by first filtering it:

var active_arr = this.collection.where({active: true});
var collection = new Backbone.Collection(active_arr);

//call render code