Skip to content

Missing watch on options.enableFiltering #2433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TheHalcyonSavant opened this issue Dec 24, 2014 · 7 comments
Closed

Missing watch on options.enableFiltering #2433

TheHalcyonSavant opened this issue Dec 24, 2014 · 7 comments

Comments

@TheHalcyonSavant
Copy link

I see many grid options are not watched, including enableFiltering on both the grid and columns. Any plans for implementing watchers on most options for dynamic change ? (I'm reading the latest source codes)

@PaulL1
Copy link
Contributor

PaulL1 commented Dec 24, 2014

Refer #1819. Our general preference is to not implement additional watchers.

@TheHalcyonSavant
Copy link
Author

Thanks for the quick response.

Now, I'm struggling to find a solution with registerDataChangeCallback with possibility to extend ui-grid/uiGridHeaderCell. I can't think of easy solution, because uiGridHeaderCell directive has isolated scope. Also, col.enableFiltering doesn't respond to changes on uiGridCtrl.grid.options.enableFiltering, where uiGridCtrl is required from one of my custom directives within the grid (called 'uiGridToolbar').

i will be really pleased If I know how to change the child scope of the grid sub-directives from outside (without modifying the source of course). Or if there is some easier solution that I'm forgetting ?

@TheHalcyonSavant
Copy link
Author

ok, I found a different solution for my problem. I don't have to watch enableFiltering, I can enable the grid's filter as default on load, and then use some DOM hide/show toggling from my internal directive 'uiGridToolbar'. This way, I don't have to extend uiGridHeaderCell neither do any complications with gridApi.

@PaulL1
Copy link
Contributor

PaulL1 commented Dec 24, 2014

This is also a duplicate of #2067, which is on my list to implement sometime.

@PaulL1 PaulL1 added this to the 3.0 milestone Dec 24, 2014
@PaulL1 PaulL1 closed this as completed Jan 14, 2015
@paambaati
Copy link

@TheHalcyonSavant I'm in the same pickle. Can you show me how you managed to modify enableFiltering after loading remote data?

@PaulL1
Copy link
Contributor

PaulL1 commented Mar 31, 2015

EnableFiltering should now update with notifyDataChange, and in fact I think the tutorial has an example of this.

@TheHalcyonSavant
Copy link
Author

My enableFiltering is always true and in my uiGridToolbar directive I have filter button with onclick event that executes this:

$elem.closest('.ui-grid').toggleClass('filterable');

@paambaati you can toggle this class onload instead, in case you need only to show/hide the filters. This way it's much simpler as you don't depend on the internal watchers/events of the ui-grid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants