Enum has absolutely no effects

Enum has absolutely no effects

Alex67000Alex67000 Posts: 39Questions: 6Answers: 0
edited February 2015 in Free community support

Hi I try to use the enum plugin but it has no effect (sorting is automatically)

http://live.datatables.net/fagezevi/3/watch?html,js,console,output

When I put for example sortable:false for :
"columnDefs": [
{ type: 'enum', "sortable": false, targets: 1 }
],
It's not sortable. So the problem comes from enum.

Any help appreciated!

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    You are initialising like so:

    $('#lfp_table').dataTable( {
    ...
    

    but your HTML table id is "table".

    After you fix that, you'll find you need to deal with some other errors.

  • Alex67000Alex67000 Posts: 39Questions: 6Answers: 0
    edited February 2015

    You are right, I wanted to change the id names (to make it more simple) but I missed to change it for the one you said.

    I've find where comes the problem : it's when I use :

    "serverSide": true,
    "ajax": "datatables/scripts/server_processing.php"
    

    otherwise there's no problem and enum works well...
    I tested it with a table without this two things (with the table directly in the HTML file and not loaded by server_processing.php)

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

    "serverSide": true,

    You are using server-side processing. Therefore sorting and filtering are done at the server (the whole point of server-side processing :-) ) and a client-side sorting function will have absolutely no effect!

    If you are using server-side processing and want to modifying the sorting, you need to modify whatever server-side script you are using.

    Allan

This discussion has been closed.