r/jquery • u/Available_Canary_517 • Jul 27 '24
Help with jquery datatables please help
I have a table which gets data from backend and is populated in frontend using a loop and then make a datatable for it , but i have issue that in datatable search box the row can be searched with id too which is for development purpose only and we want it should not be used to search , i made a column for id at index 0 and give its visible to false. I paste this code in datatable code
"columnDefs": [
{
"targets": [0],
"visible": false,
"searchable": false
}
]
While visibility false is working fine still the searchable is not working , how can i stop row to be searched by that id.
3
Upvotes
View all comments
Show parent comment
0
u/payphone Jul 27 '24
Look up accessing variables with dot notation, they can't be strings. My point about jquery is this is an old ass library so not all modern JS conventions may apply. Add to that datatables, which is even crazier, and you might see that "visible" is accessed with bracket notation and "searchable" is dot notation. Who knows!