in
- Code: Select all
displayFilters: function() {
where
- Code: Select all
html += '<input id="'+instanceName+'filter_'+filterCol+'" class="filterInput" filterCol="'+filterCol+'" type="text" style="width: '+inputWidth+'px;" value="'+filterStr+'" onKeyUp="if(' + instanceName + '.enterPressed(event)){' + instanceName + '.handleFilterSearch(this); return false;}" />';
i modified it with this function with an If & else statement to identify which column is being called.
filtercol variable is the name of the column so in my example the column name is "first_name"'
Replace above code with this (statements do not need brackets)
- Code: Select all
if(filterCol == "first_name")
html += '<select id="'+instanceName+'filter_'+filterCol+'" class="filterInput" filterCol="'+filterCol+'" type="text" value="'+filterStr+'" onchange="'+ instanceName + '.handleFilterSearch(this);"><option></option><option value = "Alex">Alex</option><option value = "John">John</option><option value = "Sarah">Sarah</option></select>';
else
html += '<input id="'+instanceName+'filter_'+filterCol+'" class="filterInput" filterCol="'+filterCol+'" type="text" style="width: '+inputWidth+'px;" value="'+filterStr+'" onKeyUp="if(' + instanceName + '.enterPressed(event)){' + instanceName + '.handleFilterSearch(this); return false;}" />';
The end result is a drop down list for my 'first_name' column and text inputs for the others.