Use TAB to submit and move to next cell DataTable Editor | Tab to submit | Use tab to submit inline

Use TAB to submit and move to next cell DataTable Editor | Tab to submit | Use tab to submit inline

aungkoheinaungkohein Posts: 38Questions: 5Answers: 0
edited November 2018 in Free community support

Hi guys!

Here is the scenario:
1. Use wants to use inline Editor
2. User wants to use TAB key to move around the table
3. User wants to submit data edited in the cell via TAB key.

Solution:

file: js/tables.yourprojectname.js

// when tab key is pressed  
    $('#yourtablename').on( 'keydown', 'tbody', function (e) {

        if(e.which == 9) {                   //TAB key                   
            e.preventDefault();           //Reset browser default; to preven TAB to select items outside your table.

            var $input = $('form input');
            $input.eq( $input.index( this ) + 1 ).focus();  //Moving to next cell

            table.keys.enable();
        }
   } );  

Hope this help!

This discussion has been closed.