-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Added "columnsFilters" feature #4108
Conversation
9201e1f
to
8ba9335
Compare
602319c
to
538a2b1
Compare
@Webiks I just noticed all of the ddescribe and iit in the tests. |
Good catch @swalters |
e113bde
to
f8a0427
Compare
Sorry about that. It's now updated with the new version - I've also added some API and more unit tests. |
4ddc10d
to
7fbcecd
Compare
d9bba45
to
af11428
Compare
<br> | ||
<br> | ||
<button id='toggleFiltering' ng-click="toggleFiltering()" class="btn btn-success">Toggle Filtering</button> | ||
<div id="grid1" ui-grid-columns-filters-directive ui-grid="gridOptions" class="grid"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ui-grid-columns-filters-directive
This isn't the naming convention we follow for directive names on our features.
bb788d0
to
c5986e7
Compare
Columns filters is a feature that enables the user to add a filter button to the column header. This button opens a popup with a filter form. This extends the regular filtering by ui-grid by enabling an "or" logic to filter by. Fixed a bug with service.clear The clear function would have thrown an error when clearing a non array filter.term property. Added "dynamic selectOptions" Now also clears predefined filters Fixed the dynamic select change Added feature tutorial Change directive name to fit convention uiGridColumnsFiltersDirective -> uiGridColumnsFilters require uiGrid in the uiGridFilter directive Changed css class .dtl -> ui-grid-date-time-picker Name conventions to files and folder of the columnsFilters feature And added bootstrap to the .less file Another commit Another commit Remove old folder Added angualr merge fallback Recursive "extend" for angular < 1.4 Fixed the unit tests for columnsFilters
70a93e3
to
5e34246
Compare
Live example: http://plnkr.co/edit/jyTAAb3jzzj0D3C439db?p=preview (there's an issue with ttf/woff files on plnkr but aside from that, the feature works). I'm certain I haven't got everything right, but this is a great alpha for this powerful feature and comments/requests would be very much appreciated. |
I just took a quick look at the plunker, I haven't reviewed the source. There are a few UI things that should be updated to match the styling of the rest of the grid, and it should automatically filter as you type to more closely match the functionality of the default filtering. In light of our recent conversations about moving features to separate repos, I really think this is a stand-alone plugin and doesn't belong in the core repository. |
Thanks. I didn't do the automatic filter by design. Since it is planed with a "filter" button in its UI, the user would expect the filter to work only when clicking the filter (at least, that what my end user wants). |
@yccteam I apologize that we didn't update the contributing guidelines earlier. I have just done so, in #4767, which is pending a proof-read. This looks like a great feature, thanks for the time you put into it. We would love to see it maintained as a plugin. Here are a few other plugins http://ui-grid.info/docs/#/tutorial/299_third_party_features. The policy we decided on at one of our recent team meetings is "if it can be a plugin, it should be", and this looks like a great candidate for a plugin. The core team has limited time, and we are really struggling to keep up with issues as it is, as we add more features, it is more for us to maintain. One of our goals for 3.1 is to move many of the existing features into separate repositories to be offered as plugins. I am closing this PR, please don't take it personally. We appreciate your contributions to ui-grid. |
I completely understand. So... is there a guide on how to do it? Or do I just create a repo, add bower to it, and send you the details? Any guidelines for using .less/external HTML files etc.? |
guide is here: http://brianhann.com/write-your-own-ui-grid-plugin/ I don't know why this isn't showing on the developer.md markup. it's in the raw file. BTW, I will be using your feature internally in the future so maybe I can help with some PR's. |
@biksteam hi, columnsFilters feature is not available in 4.0 version. Is there any replacement for this feature? |
Columns filters is a feature that enables the user to add a filter
button to the column header. This button opens a popup with a filter
form.
This extends the regular filtering by ui-grid by enabling an "or" logic
to filter by.