Due to IE11 bug, placeholder text is used as column filter search value, hiding all results
Closed this issue · 11 comments
Today I tried to get mvc.jquery.datatables to work in my MVC5 project.
I was using: UseColumnFilterPlugin = true;
It now turns out that using this option show you for each column an extra search box with a placeholder value (column (display)name). But this placeholder value is also used as a search value which results in 'No matching records found'. How can I get rid of this list of SearchValues (which still contains all placeholder values). Even restarting browser and/or VS2015, and switching off UserColumnFilterPlugin, those SearchValues list (inside DataTablesParam) is still remaining.
I just figured out that I got this behavior on IE11 (in e.g. Chrome it works well)
I'm not totally sure I understand the problem. Is it that you don;t want to use the feature, but can't turn it off? Maybe you need to clear localstorage.
Is the behaviour different between Chrome and IE11? It may be a bug in the columnfilters plugin.
I want to use it, but it turned out that IE11 uses the placeholder text as search value. I find those back in the SearchValues list inside DataTablesParam.
So, because I want to continue to test other things, I thought I switched it off for the time being, but it seems that those values are cached in some way
It looks like this is probably related to a well known issue with IE11 - if you want to fix it, you'll probably have to tweak the columnfilters library
ok. thanks! I will just leave 'UseColumnFilterPlugin' aside for now. (only now pagination stopped working...both on IE and Chrome, I've to see what I've demolished)
Sorry for bother you, but do you have aAny idea if I am missing something, cannot get pagination back to work:
public ActionResult ProductGroups()
{
var getDataUrl = Url.Action(nameof(ToolsController.GetProductGroupData));
var vm = DataTablesHelper.DataTableVm("tblProductGroup1", getDataUrl);
vm.Filter = true;
vm.ShowFilterInput = true;
vm.StateSave = true;
vm.LengthMenu = LengthMenuVm.Default();
vm.LengthMenu.RemoveAll(t => t.Item2 == 5);
vm.PageLength = 25;
vm.ColVis = true;
return View(vm);
}
LengthMenu does work, but pagination not.
Hmm, I don't know without seeing the project - usually it's easiest to make your code exactly like the HomeController example again and remove things until it's what you want.
Are the paging options (prev,next, page size) displayed in the UI?
Have a look at the ajax requests being made in devtools/fiddler. Is data being requested/returned?
Yes, paging options are available and looks correct (1 - 12). I just got the entire list back (116 records), but the first 10 are default shown.
I will recreate the entire stuff from scratch (although it looks like the HomeController example)...
Make sure you've cleared localstorage/cookies. The web response should only contain 1 page worth of data, maybe the page length is very high?
No, page length is default 25, I reset it to 10
Closing as this conversation has petered out.