bootstrap-table : Always 2 "post-body.bs.table" events on table create -
i have bound bootstrap table "post-body.bs.table" display "card" summary of first row of table upon table create. need know when table has completed processing , ready dom can select first row of table , display card. i've noticed upon table create, there 2 (2) "post-body.bs.table" events generated. need understand why 2 (2) events generated on each create card flashes twice (because of animation). there "final" table-create event can bind to?
// here's table create
$("#mycasesresultstable").bootstraptable({ sortname: 'lastmodified', sortorder: 'desc', exportoptions: { filename: "${message(code:'vote4.case.file.export.filename')}", displaytablename: true, tablename: "${message(code:'vote4.case.file.export.filename')}", jspdf: {format: 'bestfit', margins: {left: 20, right: 10, top: 20, bottom: 20}, autotable: {styles: {overflow: 'linebreak'}, tablewidth: 'wrap' }} }, queryparams: function (params) { var customparams = fa.casefile.home.getdynamicparameters(); var params = jquery.isemptyobject(customparams) ? params : customparams; return params; }, ajaxoptions: { method: 'post', url: url, }, ajax: function (request) { $.ajax(request); }, responsehandler: function (result) { rowsdata = processrows(result.data) return { data : rowsdata }; } });
// here post-body event
$(document).on('#mycasesresultstable post-body.bs.table', function (data) { $("#mycasesresultstable").children('tbody').children('tr:first').addclass('active'); $('#mycasesresultstable td .due-done').closest('tr').css('color', '#b8b8b8'); fa.casefile.home.updatecontactcard($("#mycasesresultstable").bootstraptable('getdata')[0]); });
Comments
Post a Comment