Search code examples
jquery-jtable

Deleting a row from JQuery Jtable Client Side only


I am trying to delete a row from JTable in client side only.But somehow i am not able to get the value of the key of the selected record.See the code below

            deleteAction :  function (postData) {
                var row_id = $('.jtable-data-row').attr('data-record-key');
                $('#AuthorTableContainer').jtable('deleteRecord', {
                key: row_id,
                clientOnly:true
                });
            }},

The problem is when the table contains the multiple record.then in that case "tr" attributes become

"jtable-data-row jtable-row-even" in that case i am not able to get the value of the data-record-key.

Is there any other way to delete a row from JTable from client side only?


Solution

  • Here it is

    deleteAction :  function (data) {
        $('#AuthorTableContainer').jtable('deleteRecord', {
            key: data.keyValue,
            clientOnly:true
        });
    }},