Editor Selectize jumps horizontally to the beginning of the table

Editor Selectize jumps horizontally to the beginning of the table

transloydtransloyd Posts: 10Questions: 3Answers: 0

When an inline editor is opened on Selectize field, the table jumps to the beginning of the table

Answers

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

    Hi,

    I've tried my load Selectize example to see if this happens and wasn't able to reproduce it. Are you able to give me a link to a page showing the issue please? If that isn't possible, can you show me the code you are using for DataTables and Editor?

    Allan

  • transloydtransloyd Posts: 10Questions: 3Answers: 0
    edited July 2018
    let EDITOR = new $.fn.dataTable.Editor({
                            ajax:  {
                                url: '/records/get_records',
                                type: 'POST'
                            }
                            table: self.cfoTable,
                            idSrc: 'id',
                            fields:  [
            /// ....more columns
            {
                    name: 'payment_form_cl',
                    type: 'selectize',
                    options: [
                        {
                            label: 'б\\н с НДС', value: 'б\\н с НДС'
                        }, {
                            label: 'б\\н без НДС', value: 'б\\н без НДС'
                        }, {
                            label: 'б\\н с 0%НДС', value: 'б\\н с 0%НДС'
                        }, {
                            label: 'Нал', value: 'Нал'
                        }, {
                            label: 'Софт', value: 'Софт'
                        }
                    ]
                }
            /// ....more columns
        ]
                        });
    
    $(self.cfoTable).DataTable({
        serverSide: true,
        processing: true,
    
        dom: 'r<"main_table"<<"table_header clearfix"lB<"calculation_errors">><t><"table_footer clearfix"ip>>>',
        scrollY: tableHeight,
        scrollX: true,
        stateSave: true,
        lengthMenu: [20, 30, 40, 50, 60, 100],
        select: true,
        autoWidth: true,
        ajax:  {
            url: '/records/get_records',
            type: 'POST'
        },
        keys: {
            editor: EDITOR,
            editAutoSelect: false,
            editorKeys: 'tab-only'
        },
        columns: [
            /// ....more columns
            { data: 'payment_form_cl', name: 'payment_form_cl', className: 'block-z' }
            /// ....more columns
        ],
        language: LanguageOptions
    });
    
     $(self.cfoTable).on( 'dblclick ', 'tbody td:not(:first-child)', function (e) {
          EDITOR.inline(this);
    } );
    
    
  • ihuangmxihuangmx Posts: 26Questions: 9Answers: 1
    edited January 2019

    I use the 'radio' type and encountered the same problem,and I also try the selectize type and has the same problem

    https://datatables.net/forums/discussion/53972/inline-editor-radio-type-will-jump-to-unexpected-position-when-start-edit-or-select#latest

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

    @ihuangmx - I've posted a reply in your other thread.

This discussion has been closed.