I’ve tried to emulate the example for custom filtering using function allForOne:
http://docs.webix.com/samples/15_datatable/03_filtering/04_one_for_all_2.html
Unfortunately, when I try to create similar column headers, my datatable displays empty cells.
The following snippet has the attempted column definitions currently commented out ( var user_columns) and the column definition that works (but does not have the filter) is currently displayed.
http://webix.com/snippet/e04e4858
Can someone tell me what I’m missing? Why does my datatable display empty cells when I try to put the filtering into the headers?
This was really bugging me, so I figured it out… At least partially by accident:
http://webix.com/snippet/90abe19c
It turns out you don’t need to fully define all of the initial row parameters inside a single array/object. So the column defs for Name and NUID now look like
{"header":["Name",{"content":"textFilter","compare":oneForAll,"placeholder":"Enter search string...","colspan":2}],"template":"#lastname#, #firstname#","sort":"string","fillspace":4},{"header":"NUID","id":"nuid","sort":"string","fillspace":1}
The template for Name comes after the filter definition, and NUID does not need a second line defined. Also, removed the quotes from around the function name oneForAll, allowing it to be passed as an actual function, not the name of a function.
Finally, I updated oneForAll to user lowercase and indexOf() for partial matches. This will help my users match names they are not 100% sure how to spell them OR nuid values that have transposed digits.