Let me start by saying I am VERY new to jQuery or any JavaScript programming so please excuse any noob-related mistakes.
I am creating a web app for my company using SlickGrid which will load a different dataset based on the users' role, so my fields will be defined by a dynamic sql query, rather than hard-coded.
I would like to apply Andrew Child's filter on the fork of SlickGrid to the lastest version of the master branch. The filter is displayed on this example: https://github.com/andrewchilds/SlickGrid/blob/master/examples/example15-fork-feature-demo.html
I created a control (using the pager control as a template) to add the filtering header elements. It looks great! Now I just need to make it functional. In following https://github.com/mleibman/SlickGrid/blob/master/examples/example4-model.html it looks like I need to modify this function to loop through the columns, return the filter type and column name, rather than hard-coding the filter type and column name.
function myFilter(item, args) {
if (item["percentComplete"] < args.percentCompleteThreshold) {
return false;
}
if (args.searchString != "" && item["title"].indexOf(args.searchString) == -1) {
return false;
}
return true;
}
My questions are:
- Am I even close to being on the right track?
- If yes to 1, how do I modify myFilter() and dataView.compileFilter()?
Thanks for your help!