Deselect row on update

Deselect row on update

sendtextsendtext Posts: 5Questions: 0Answers: 0
edited October 2012 in Editor
I am using 'multi' select in my table. When I edit a row's data using the editor I need the row to deselect after the successful update. I can't seem to get fnSelectNone to fire after the update. Any idea how I might accomplish this? Below is my non-working code.

[code]
editor.on('onSubmitSuccess', function () {
this.fnSelectNone();
} );
[/code]

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    The Editor event handlers are executed in the scope of the Editor instance, so you need to get a reference to the TableTools instance in order to execute the `fnSelectNone` method (which is TableTools method, not Editor).

    So what you can do is this:

    [code]
    editor.on('onSubmitSuccess', function () {
    TableTools.fnGetInstance( '{tableId}' ).fnSelectNone();
    } );
    [/code]

    A bit ugly I know :-(. You might want to pick up the reference to TableTools just after you initialise DataTables:

    [code]
    var tt = TableTools.fnGetInstance( '{tableId}' );
    [/code]

    Allan
  • sendtextsendtext Posts: 5Questions: 0Answers: 0
    Thanks man! That is what I needed.
This discussion has been closed.