Refresh data

Refresh data

jvcunhajvcunha Posts: 81Questions: 10Answers: 1

I'm testing datatables with Asp.Net WebForms and GridView. Is working perfectly but can not do refresh after insert or edit a record.
I searched the forum and found several solution as mytable.draw () but nothing worked. Need to click a button and give refresh the data, without postback via javascript / jquery.
The loading of data is done in the codebehind Page_Load.
Can anyone help?
Table creation example: (myTable is asp.net gridview)

  $(document).ready(function () {
    var table = $('#<%=myTable.ClientID%>').DataTable({
        pagingType: 'full_numbers',
        retrieve: true,
        language: {
            sEmptyTable: 'Nenhum registro encontrado',
            sInfo: 'Mostrando de _START_ até _END_ de _TOTAL_ registros',
            sInfoEmpty: 'Mostrando 0 até 0 de 0 registros',
            sInfoFiltered: '(Filtrados de _MAX_ registros)',
            sInfoPostFix: '',
            sInfoThousands: '.',
            sLengthMenu: '_MENU_ registros por página',
            sLoadingRecords: 'Carregando...',
            sProcessing: 'Processando...',
            sZeroRecords: 'Nenhum registro encontrado',
            sSearch: 'Pesquisar',
            oPaginate: {
                sNext: 'Próximo',
                sPrevious: 'Anterior',
                sFirst: 'Primeiro',
                sLast: 'Último'
            },
            oAria: {
                sSortAscending: ': Ordenar colunas de forma ascendente',
                sSortDescending: ': Ordenar colunas de forma descendente'
            }
        },
        tableTools: {
            sRowSelect: 'single'
        }
    });

    $('#<%=myTable.ClientID%> tbody').on('click', 'tr', function () {
        if ($(this).hasClass('selected')) {
            $(this).removeClass('selected');
        }
        else {
            table.$('tr.selected').removeClass('selected');
            $(this).addClass('selected');
        }
    });

});

This discussion has been closed.