Wrong sorting in combo box from Alt Editor Form

Wrong sorting in combo box from Alt Editor Form

stan1324stan1324 Posts: 1Questions: 1Answers: 0

Dear all,

I have the following code:

$('#my_table').DataTable( {
    data: [{col1: "b"}],
    columns: [
    {
        data: "col1",
        title: "Column 1",
        type: "select",
        options: { 
            "z" : "A Text (z)",
            "y" : "B Text (y)",
            "2" : "C Text (2)",
            "1" : "D Text (1)"
        }
    }], 
    dom: 'Bfrtip',
    select: 'single',
    altEditor: true,

    buttons: [
        { text: 'Add', name: 'add' },
        { extend: 'selected', text: 'Edit', name: 'edit' },
        { extend: 'selected', text: 'Delete', name: 'delete' }
    ]
});

When I click Edit and open alt-editor form i have a select box including the elements sorted as follows:

<select class="form-control" id="col1" name="Column 1" placeholder="Column 1" data-special="" data-errormsg="" data-uniquemsg="" data-unique="false" required="">
    <option value="1">D Text (1)</option>
    <option value="2">C Text (2)</option>
    <option value="z">A Text (z)</option>
    <option value="y">B Text (y)</option>
</select>

How can I have them sorted as they're placed in options() - sorted by name:

    <option value="z">A Text (z)</option>
    <option value="y">B Text (y)</option>
    <option value="2">C Text (2)</option>
    <option value="1">D Text (1)</option>

Thanks a lot,
Stan

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    That'll be an issue with alt-editor so you'll need to contact them. With Editor, those labels would be sorted by name - please see the Location column in this example,

    Colin

Sign In or Register to comment.