Multiple selection. Error with filter

Multiple selection. Error with filter

comptabilitatcomptabilitat Posts: 10Questions: 3Answers: 0
edited August 14 in General

Hi,

I continue trying to adapt the multiple selection example: https://editor.datatables.net/examples/datatables/mJoin.html

All works fine, I can see and modify data amb multiselect values.

The problem is with the filter. When a put a character in the filter, it returns me an error

DataTables warning: table id=pacients_diagnostics_mostra - Unknown field: pacients_diagnostics_view (index 3)

Table pacients_diagnostics_view has the multi selected values.

Datatables column definition is:

        columns: [
            { data: "id"  },
            { data: "npat" , visible: false },
            { data: "data_diagnostic" },
            { data: 'pacients_diagnostics_view', render: '[, ].microorganisme_mecanisme' }
        ],

Editor is:

    editormostra = new $.fn.dataTable.Editor( {
        "ajax": "ajax/pacientsdiagnosticsmostra/"+npat,
        "table": "#pacients_diagnostics_mostra",
        "fields": [ {   
                label: "NHC:",
                name: "npat",
                type: "readonly",
                def: npat
            },{
                label: "Data del diagnòstic:",
                name:  "data_diagnostic",
                type: "readonly"
            },{
                label: "Microorganismes:",
                name: "pacients_diagnostics_view[].id",
                type: "select",
                multiple: true,
                fieldInfo: 'Amb la tecla CTRL podeu seleccionar més d´un valor'
            }
        ]

I compare with original exemple, where filter works and i can't see the error.

I use type : select. In original example is datatables, but in my environment this doesn't works. May be old version.

Any help will be welcome. Many thanks !!!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,569Questions: 1Answers: 10,481 Site admin
    Answer ✓

    It sounds like you have server-side processing enabled (serverSide), although the DataTables configuration isn't present so I can't be 100% certain (I am 99% sure though!).

    Unfortunately search does not work on Mjoined data with server-side processing enabled. That is currently a limitation of the server-side libraries for Editor that I'm aware of, but haven't yet found a good cross database solution for.

    At the moment you need to add searchable: false (and orderable: false) for Mjoined columns I'm afraid.

    Regards,
    Allan

  • comptabilitatcomptabilitat Posts: 10Questions: 3Answers: 0

    I comment serverSide option and worked !!!!.

    Many many thanks Allan.

    Greetings from Spain.

Sign In or Register to comment.