Guilherme Costa Guilherme Costa - 23 days ago 13
Javascript Question

Bug when next tab with JsGrid

why jsgrid presentation bug when i click at tab next? I try destroy e and raise the jsgrid and not solved.

$('a[href="#prestador"]').on('show.bs.tab',function (e) {
$("#nota_prestador").jsGrid("destroy");
createGrid('nota_prestador',data,'CPF/CNPJ TOMADOR');
});
}


enter image description here

Answer

Rendered in a hidden container (not opened tab in this case), js-grid cannot calculate size properly. So you have to call refresh on tab open event:

$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
  $("#jsGrid").jsGrid("refresh");
});

Checkout the issue on the project GitHub page: https://github.com/tabalinas/jsgrid/issues/49

Comments