Error searching with serverside mjoin

Error searching with serverside mjoin

crismablancocrismablanco Posts: 5Questions: 4Answers: 0

Hi, I need this example working with ServerSide processing.
https://editor.datatables.net/examples/advanced/joinArray.html

When I search in the client side I have this error:
DataTables warning: ... Unknown field ...

I have to make a search of an Mjoin field with a serverside processing.

I have more than 16K rows.

In the example I`ve mentioned I would like to search by the 'permission' field
Thanks

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Unfortunately the PHP libraries don't support search on the Mjoined fields when server-side processing is enabled. The reason for this is that the query is split into two for efficiency, so the search has already been done by the time the Mjoin query is executed. They also don't support sorting for the same reason.

    Allan

  • crismablancocrismablanco Posts: 5Questions: 4Answers: 0

    Ok so, how can I solve the problem ?
    Thanks !!

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    At the moment you'd need to disable search and ordering on those columns - columns.searchable and columns.orderable.

    Allan

  • naspersgaspnaspersgasp Posts: 53Questions: 14Answers: 1

    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 ordering is disabled. But the searching still happens. I do have server side processing enabled as well.

    Any idea? Thanks.

    Regards.

This discussion has been closed.