Custom property in columns.data
Custom property in columns.data

Hello,
I would like to send an extra parameter to the server, the comparison operator which is used on the server side to search a column.
It would be fine to get it through columns[0][data][comparison]
.
This code seems to work well :
columns: [
{
data: {
_: "firstName",
comparison: "eq"
}
}
]
On the server-side, these variables are sent:
columns[0][data][_]: firstName
columns[0][data][comparison]: eq
Even if it works, I am annoyed because my data object does not respect the structure described in the documentation (_, filter, display, type or sort).
Is there a documented way to achieve what I want ?
Thanks for your answer !
This question has accepted answers - jump to:
Answers
You can send extra parameters with
ajax.data
.Colin
Hello Colin,
Thanks for your answer !
This option is very interesting and I managed to use it successfully with the code below :
However, I find annoying to rely on a column index (0 in this case) to add the extra parameter.
It can make maintenance tedious.
Is there a way to make it work without specifying the column's index ?
To me, the optimal solution would be to add the extra parameter in the column definition.
In this 2015's discussion, @allan says :
Did you know if it has been implemented ?
No it never did I'm afraid. Currently the only way would be to do as you did (or create your own abstraction / mapping for it).
Allan
Hello @allan,
Thanks for your answer.
I will try to make my own plug-in to reuse it through my projects.
Is there an official documentation which explains how to do it ?