0
votes

I just found ng-grid and would like to use it for a server-side filtered and ordered table, which shouldn't be a problem.

But I'd like to define the filtering in cells that are in the next row under the header row. Filtering cells could be:

  • text search
  • date range
  • number range
  • enum multi-select
  • ...?

I've not found, how I could add an extra row under the header row. I could overwrite the header cell templates, but I'm fine with them. I'd rather "extend" them or have a plugin that would be responsible to render the row under the header row.

Is there a way to refer to the original template when defining headerCellTemplate? I just want to add something to the existing template.

Do you have more infos on plugins, their capabilities and how to write them?

1

1 Answers

0
votes

We had a similar requirement. Since our column defs were all dynamically driven, we also included an attribute called inputMappings. Which contained the input type, select options, etc. Then wrote an ng-grid plugin which added a watch to that scope variable, parsed the colDefs variable - creating an row by extracting the elements from our inputMapping object. Basically the "field_name" was the linkage between inputMapping and colDefs.

Once we had the row comprised of ngCells, that contained the proper input element, contained ng-models linked to the fields, we insterted after the gird.$headercontainer and recompiled ng-grid. This added the UI. Our next challenge was writing a custom ng-grid server-side filter to leverage the nifty new "ngFilterBar".