'No data available in table' after changing filters
'No data available in table' after changing filters
I am having trouble with a couple new projects (older projects appear to work fine).
When I click on a couple filters in SearchPanes (cascading is turned on), the dataTables correctly filter. But as I unselect the filters to try and make different filter selections, the SearhPanes all say 'No data available in table'. Even clicking 'Clear All' in the SearchPane does not work. I need to reload the page to get the values back in the SearchPane panels.
var DevicesTable = $('#Devices').DataTable({
searchPanes: {
cascadePanes: true,
viewTotal: true,
controls: false,
layout: 'columns-6',
threshold: 1,
//columns: [1, 2, 3, 4], //alertDates, alerts, CaseStatus, openActions
emptyMessage: "<i><b>none</b></i>"
},
dom: 'PBfrtip',
ajax: 'api/Devices',
columns: [
{
title: "Lines",
className: 'details-control',
//orderable: false,
data: null,
defaultContent: '',
width: '10%'
},
{ data: "Devices.CM_ID", title: "ID", searchPanes: { show: false } },
{ data: "Devices.Department", title: "Department", searchPanes: { show: true } },
{ data: "Devices.DepartmentName", title: "Department Billed", searchPanes: { show: true } },
{ data: "Devices.DEVICE_NAME", title: "DEVICE_NAME", searchPanes: { show: false } },
{ data: "Devices.DESCRIPTION", title: "DESCRIPTION", searchPanes: { show: false } },
{ data: "Devices.DEVICE_SECURITY_PROFILE", title: "DEVICE_SECURITY_PROFILE", searchPanes: { show: false } },
{ data: "Devices.DEVICE_POOL", title: "DEVICE_POOL", searchPanes: { show: true }},
{ data: "Lines.DIRECTORY_NUMBER", title: "DIRECTORY_NUMBER (line 1)", searchPanes: { show: false } },
{ data: "Lines.VOICEMAILPROFILE", title: "VOICEMAILPROFILE (line 1)", searchPanes: { show: true }}
],
order: [[1, 'asc']],
select: { style: 'single' },
lengthChange: false,
autoWidth: true,
scrollX: true,
buttons: [
{
extend: 'excelHtml5',
autoFilter: true
}
]
});
setting CascadePanes to false seems to resolve the issue, but of course then they don't cascade.
Answers
I'm not seeing it with our examples. Are you able to link to a page that demonstrates the issue, please. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
yeah, that's the problem. I can't reproduce the issue either on your test site, even if i use the same js/css includes from the html page. unfortunately I can not provide a link to page because it is on our intranet. And it works just fine on other projects where I used the download builder tools to create the project.
However, I create two c#/mvc projects from scratch, included these:
and for BOTH projects I created this way, SearchPanes is acting the same way. When I unselect the filters, instead of showing all data, in the SearchPanes it shows 'No data available in table'. (although the dataTable itself returns to being unfiltered and shows all the data)
So odd.
Hi @montoyam
Without a test case it is going to be hard for us to work out what is going on.
Try changing your sources to use either 1.2.2 or the nightly builds - it might be something that has been fixed already...
Thanks,
Sandy
will do. Is there any way to view in the console what the filter is set to? or are there any other debug methods for SearchPanes?
(regarding my last comment, the filter for the SeachPane panels are incorrect while the filter for the DataTables appears to be correct)
This thread shows how to see what's been selected, but as Sandy said, we'd need to see this one to be able to debug it,
Colin
oh my, it just got more confusing. Another user tried it on their machine and it works just fine. On my machine, I cleared cookies, and tried different browsers and it doesn't work on mine.
Are they using the same browser or OS? Maybe also try it in private browsing mode in case a browser extension is interfering somehow.
Colin
For these two projects in which the SearchPanes was acting odd, I was using CDNs. My other projects in which SearchPanes behaves correctly I used the 'Generator' tool to download the javascript and css files into the project file. I brought these js and css files into the two projects that were not working and all is fine now. something was not working correct (on my machine anyway) using the CDNs (shown in my original post).
I don't want to take anyone's time on this as it is now working with the downloaded js and css files, but if someone wants to think about this further I can leave the question open
Sounds odd but without seeing it it'll be hard to debug. If you're able to create a couple of test case for both conditions, we're happy to take a look,
Colin