Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

aspcore columns not being populated #60

Open
lchilson opened this issue Jul 10, 2017 · 4 comments
Open

aspcore columns not being populated #60

lchilson opened this issue Jul 10, 2017 · 4 comments
Assignees
Labels
bug Decribes a bug or an invalid behavior from the library to-investigate Requires further investigation
Milestone

Comments

@lchilson
Copy link

Columns array is not being populated in IDataTablesRequest

@kayakguy
Copy link

I'm running into the same issue. When I receive the IDataTablesRequest object in my mvc controller method for getting the table data, the columns array is always empty This, combined with the missing 'order' information that is noted in another issue post, makes it impossible for me to implement column ordering, or column specific searches.

Could there be something I'm doing wrong, or could something in a new release of the datatables have broken the IDataTablesRequest?

I'm running v1.10.15 of the datatables library.

In case this is of any help at all, the request payload from datatables, looks like the following. Other data (like draw, length, and start) are coming through. But columns is always an empty array.

{
"draw": 1,
"columns": [{
"data": null,
"name": "",
"searchable": true,
"orderable": false,
"search": {
"value": "",
"regex": false
}
},
{
"data": "id",
"name": "Id",
"searchable": false,
"orderable": false,
"search": {
"value": "",
"regex": false
}
},
{
"data": "title",
"name": "Title",
"searchable": true,
"orderable": true,
"search": {
"value": "",
"regex": false
}
},
{
"data": "categoryName",
"name": "CategoryName",
"searchable": true,
"orderable": true,
"search": {
"value": "",
"regex": false
}
},
{
"data": "description",
"name": "Description",
"searchable": true,
"orderable": true,
"search": {
"value": "",
"regex": false
}
},
{
"data": "imageFilename",
"name": "ImageFilename",
"searchable": true,
"orderable": true,
"search": {
"value": "",
"regex": false
}
},
{
"data": "elementId",
"name": "ElementId",
"searchable": true,
"orderable": true,
"search": {
"value": "",
"regex": false
}
},
{
"data": "isNew",
"name": "IsNew",
"searchable": true,
"orderable": true,
"search": {
"value": "",
"regex": false
}
},
{
"data": "sku",
"name": "SKU",
"searchable": true,
"orderable": true,
"search": {
"value": "",
"regex": false
}
},
{
"data": "programNames",
"name": "ProgramNames",
"searchable": true,
"orderable": true,
"search": {
"value": "",
"regex": false
}
},
{
"data": "details",
"name": "Details",
"searchable": false,
"orderable": false,
"search": {
"value": "",
"regex": false
}
},
{
"data": "clone",
"name": "Clone",
"searchable": false,
"orderable": false,
"search": {
"value": "",
"regex": false
}
}],
"order": [{
"column": 1,
"dir": "asc"
}],
"start": 0,
"length": 50,
"search": {
"value": "",
"regex": false
}
}

@demoush
Copy link

demoush commented Jul 28, 2017

Hi,

I had the same issue.

Make sure the columns configuration do not contains empty data which cause de databinder to break when parsing querystring.

Not working example:

"columns": [
{
"data": ""
},
{
"data": "nom",
"defaultContent": "Not set",
"render": function (data, type, full, meta) {
return '' + data + '';
}
},

Working exemple
"columns": [
{
"data": "selection"
},
{
"data": "nom",
"defaultContent": "Not set",
"render": function (data, type, full, meta) {
return '' + data + '';
}
},

@gabrieleguia
Copy link

Any updates on this issue? I'm facing the same problem. Trying to implement multiple column filtering, but not getting column array in IDataTablesRequest instance.

@MaverickMartyn
Copy link

MaverickMartyn commented Feb 1, 2018

I am still not sure what the exact bug is, but I have learned some new information, and a possible workaround.
For me, the bug was caused by a column in my clientside "columnDefs" setting, where the "data" parameter was set to null. Pretty much what is described above.
This was because I used the column as a select box column, for the "select" plugin.
My workaround was to give it the Id field of my models as data, and using the "render" setting to output an empty string instead, in order to hide it.

I will probably look into this some more later, and try to track down the actual issue causing this.

@ALMMa ALMMa self-assigned this Jun 17, 2021
@ALMMa ALMMa added the bug Decribes a bug or an invalid behavior from the library label Jun 17, 2021
@ALMMa ALMMa added this to the 3.0.0 milestone Jun 17, 2021
@ALMMa ALMMa added the to-investigate Requires further investigation label Jun 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Decribes a bug or an invalid behavior from the library to-investigate Requires further investigation
Projects
None yet
Development

No branches or pull requests

6 participants