Editor search with server side and mjoins does not work.
Editor search with server side and mjoins does not work.
naspersgasp
Posts: 53Questions: 14Answers: 1
in General
Hi,
Good day.
I've disabled searching and ordering on the client side with:
columnDefs: [
{
"searchable": false,
"targets": 6
},
{
"orderable": false,
"targets": 6
}
]
But the server side still fails with the "Unknown field: Image (index 6)" error. On the client I can see the ordering is disabled. But the searching on that column still happens on the server side.
Any idea? Thanks.
Regards.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Hi @naspersgasp ,
If
searchable
is set alongsideserverSide
, then the searchability of each column is sent to the server within the Ajax request. It's up to the server side script to then use that information and return the matching data appropriately.Cheers,
Colin
Hi,
Thanks @colin.
The server side processing is handled by the editor NodeJS library supplied . I'm not handling it manually. I just use the editor module supplied.
Regards.
Thanks for the clarification. I'm afraid that the server-side libraries do not currently support search on the MJoined columns. Search needs to be disabled for them using the
columns.searchable
option.Alternatively, if you have less than tens of thousands of rows, just disable server-side processing. The client-side will be able to search them okay.
Allan
Hi,
Good day.
What I am saying is that I am disabling them. But having them disabled does not exclude the option from being sent to the server from the client. If that makes sense? I think the client should not send the column info to the server if it is set as not searchable and not orderable.
I'll see if I can't remove the options on the server side for now. Maybe that will solve the issue in the short term.
Regards.
I see what you mean. The client side should also be seeing a
searchable
flag for the columns (which is the value ofcolumns.searchable
). So the server-side script should be checking to see if the column is marked as searchable or not before attempting to do any searching on it.Allan
Yup, the change is needed on the Node JS server side.
It is at line 1410:
and line 1423:
of editor.js
The test for false was incorrect. When I have a chance, I'll create a PR. Thanks.
Regards.
Thanks! I'm with you now - and thanks for the PR. It has been merged in and will be in the next release.
Allan