Tab between columns problem

Tab between columns problem

lockedscopelockedscope Posts: 8Questions: 1Answers: 0
edited March 2015 in Free community support

For the following example; https://editor.datatables.net/examples/inline-editing/tabControl.html apply following code in Chrome Developer Tools console.

 $('#example').off( 'click' );
 
 $('#example').on( 'click', 'tbody td:not(:first-child)', function (e) {
        editor.inline( this, {
            submitOnBlur: false
        } );
    } );

Then click on some cell and press and hold Tab key, focus moves outside of table after traversing some inputs. Then try to click on any input again, editor does not open up. Also, click New,Edit,Delete buttons the popup dialog opens and closes immediately. How could this be resolved?
Thanks

Answers

  • allanallan Posts: 63,677Questions: 1Answers: 10,497 Site admin

    This is something that has been fixed in the development version and will be released in v1.4.1 in the next couple of days.

    Having said that, there is still an issue if you use the ajax option and do not perform an asynchronous action. That is something I am working on, although it is unlikely to be address for 1.4.1 unfortunately.

    Allan

  • lockedscopelockedscope Posts: 8Questions: 1Answers: 0
    edited March 2015

    Ok thanks. I used following for ajax, is it fine?

      ajax: function (method, url, data, successCallback, errorCallback) {
                successCallback({ row: data.data });
            }
    
  • allanallan Posts: 63,677Questions: 1Answers: 10,497 Site admin

    Actually no - that is synchronous. What you would need to do is:

    setTimeout( function () {
      successCallback({ row: data.data });
    }, 10 );
    

    Not ideal I realise!

    Allan

  • lockedscopelockedscope Posts: 8Questions: 1Answers: 0

    I actually do not want to post back to the server. Just build the table at client side and upload the final table (as json) to the server.

  • allanallan Posts: 63,677Questions: 1Answers: 10,497 Site admin

    Yes, the above will do that. It just makes it async.

    As I say, not perfect, and is is a workaround for a known bug that I will address, but can't say exactly when yet.

    Allan

  • lockedscopelockedscope Posts: 8Questions: 1Answers: 0
    edited April 2015

    Are there any alternatives to ajax for saving editor value to dom table without posting to server?

  • allanallan Posts: 63,677Questions: 1Answers: 10,497 Site admin

    To a large extent Editor assumes that the data will be saved somewhere that is not the table (the table is just a display container, not a data store). You could do as you have above, which is the closest with simple Javascript, but adding rows might present more a challenge since you need to be able to uniquely identify each row (i.e. it needs a primary key value, which normally is auto-generated by a database sequence).

    Allan

This discussion has been closed.