angular-ui/ui-grid

Pinning module is a digest cycle behind

Open

#5,243 建立於 2016年3月21日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)JavaScript (5,395 star) (2,496 fork)batch import
grid-pinninghelp wanted

描述

http://plnkr.co/edit/uRUdFmj6DpD9liBwo3Cp?p=preview

Notice that when you have a pinned column and click the toggle filter button, the pinned column seems to be behind a digest cycle, showing the filtering going away/appearing as two separate components rather than one. This seems odd, especially since i'm using NotifyDataChange to tell the grid to respond to the change in the gridOptions.

You also cannot register the event handler for api.pinning.on.columnPinned unless you do it within a $timeout.

This also becomes a problem when using the restore function, it seems that for all of the modules the restore function will fire the event handlers synchronously (which is fine), except for the pinning module. See the plunker: http://plnkr.co/edit/MlEmGQJiOU9u5X81qYjS?p=preview. Notice that I am trying to not handle the columnPinned event if i am using the restore functionality, but even after the restore has already occurred, the event is being raised sometime between then and the next digest cycle. In this example, if you wrap isRestoring = false in a timeout, it will behave as expected

貢獻者指南