Michael
Michael

Reputation: 13636

How to change filter column location in ui-grid?

I use ui-grid in my project.

I need to move filtering field abovse ui-grid,like that:

enter image description here

Is it possible to implement?

Upvotes: 0

Views: 283

Answers (1)

imbalind
imbalind

Reputation: 1182

To do that you need to write the filter by yourself. It's not that hard and there's a tutorial on ui-grid.info.

What you're gonna do is create a loop that will go through all the rows and change the flag row.visible for any row that is matching/not matching the filter.

[FOLLOW-UP] In case you needed more than one column you simply should think your logic considering any possible combination of all filters.

If I remember correctly, in ui-grid they have nested loops, at first they cycle through all filters, then through all rows and if a row is refused by any filter, than it's visibility is cleared (set to false); otherwise, if all filter accept a row, it's visibility is set to true.

Upvotes: 1

Related Questions