Issues with Column Control and Column Reorder in State object
Issues with Column Control and Column Reorder in State object
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
I am using the latest libraries and noticing 2 issues both of which are tied to the state not being updated properly to reflect the current state of the table.
When i have individual search boxes using the column control search funtionality, when I type search text into the search field in column[2] the search text shows in the column control search for column[0] in the state object. I had to implement a cutom mapping function to correctly map the search to the correct column in the State object.
When reordering columns, the columncontrols in the state object do not get updated to the correct indexes that they should be. In the state object below it shows that columns 7 and 4 should be search lists not search inputs. columns 5 & 6 should be search inputs. but if you look at the colReorder and the columnControl they do not align with the correct indexes. This is causing issues for the workaround I implemented for issues 1 because the column control data does not align correctly to the indexes in the colReorder.
"colReorder": [
0,
1,
2,
3,
7,
5,
6,
4,
8,
9,
10,
11
],
"columnControl": {
"2": {
"searchInput": {
"logic": "greater",
"type": "date",
"value": "2/1/2020"
}
},
"3": {
"searchList": []
},
"4": {
"searchInput": {
"logic": "contains",
"type": "text",
"value": "acc"
}
},
"5": {
"searchList": []
},
"6": {
"searchInput": {
"logic": "contains",
"type": "text",
"value": "rn"
}
},
"7": {
"searchList": []
},
"8": {
"searchInput": {
"logic": "less",
"type": "date",
"value": "2/1/2024"
}
},
"10": {
"searchList": []
},
"11": {
"searchList": []
}
},
Answers
for reference this is the mapping function i had to implement the state save to correctly map the state column control data (but again this relies on the column controls being aligned with the colReorder which is not)
Can you link to an example showing the issue please?
Many thanks,
Allan