Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82439

Control ordering of labels in multi value column

$
0
0

I have a multi value column that I would like to not have sorted within the cell. For example the server returns the data in the following order C, F, A, D. The display is A, C, D, F. Is there an option to turn off the data ordering? Or maybe I need to render the data differently.

Below is the field I don't want the values to be sorted.

Kevin

            { data: 'c.commands',
                render: '[, ].label',
                editField: 'main.fk_commands[]',
        },

Init code:

$(document).ready(function() {
    editor = new $.fn.dataTable.Editor( {
        ajax:  '/manage_ios_commands',
        table: '#edit-table',
        fields: [
            { type: 'hidden', label: 'pkid:', name: 'main.pkid' },
            { label: 'Name:', name: 'main.name' },
            { type: 'select', label: 'Type:',  name: 'main.fk_types', placeholder: 'Select a Type' },
            { type: 'select2', label: 'Commands:',  name: 'main.fk_commands[]',
                    attr: { multiple: true },
                    opts: { allowClear: true,
                            placeholder: 'Add IOS commands here',
                            tags: true,
                            tokenSeparators: [',']  }
            },
        ]
    } );

    $('#edit-table').on( 'click', 'tbody td:not(:first-child)', function (e) {
        editor.inline( this, {
            onBlur: 'submit'
        } );
    } );

    var table = $('#edit-table').DataTable( {
        ajax: '/manage_ios_commands',
        columns: [
            { data: 'main.pkid' },
            {
                data: null,
                defaultContent: '',
                className: 'select-checkbox',
                orderable: false
            },
            { data: 'main.name' },
            { data: 'type.type_name', editField: 'main.fk_types' },
            { data: 'c.commands',
                render: '[, ].label',
                editField: 'main.fk_commands[]',
        },
        ],


Viewing all articles
Browse latest Browse all 82439

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>