How are you initializing the jqGrids on the other tabs? You should initialize them when the tab is shown using the show
event, for example:
jQuery(document).ready(function() {
var initialized = [false, false];
jQuery('#tabs').tabs({show: function(event, ui) {
if (ui.index == 0 && !initialized[0]){
// Initialize grid on second tab page here...
jQuery(NOMBRE_GRID).jqGrid({
url: '/Idiomas/DatosGrid/',
datatype: 'json',
mtype: 'GET',
height: 'auto',
multiselect: true,
autowidth: true,
colNames: ['Id', 'Nombre'],
colModel: [
{ name: 'id_idioma', index: 'id_idioma', width: 100, align: 'left',
formatter: 'showlink', formatoptions: { baseLinkUrl: '/Idiomas/', showAction: 'Edit', addParam: '' }
},
{ name: 'nombre', index: 'nombre', width: 100, align: 'left' }
],
pager: jQuery(NOMBRE_AREA_PAGINACION),
rowNum: tamanoPagina,
rowList: [5, 10, 15, 20],
sortname: 'nombre',
sortorder: “asc”,
viewrecords: true,
caption: 'Idiomas'
}).navGrid(NOMBRE_AREA_PAGINACION, { edit: false, add: false, del: false, refresh: false, search: false });
});
} else if (ui.index == 1 && !initialized[1]){
// Initialize grid on second tab page here...
jQuery(NOMBRE_GRID_SELECCIONADOS).jqGrid({
url: '/Idiomas/DatosGrid/',
datatype: 'json',
mtype: 'GET',
height: 'auto',
multiselect: true,
autowidth: true,
colNames: ['Id', 'Nombre'],
colModel: [
{ name: 'id_idioma', index: 'id_idioma', width: 100, align: 'left',
formatter: 'showlink', formatoptions: { baseLinkUrl: '/Idiomas/', showAction: 'Edit', addParam: '' }
},
{ name: 'nombre', index: 'nombre', width: 100, align: 'left' }
],
sortname: 'nombre',
sortorder: “asc”,
viewrecords: true,
caption: 'Idiomas'
});
initialized[ ui.index ] = true;
});
If you are doing this approach you will also need to keep track of when each grid is initialized, so you do not try to create it a second time if the user clicks on another tab then clicks back to the previous one.