I'm trying to do a function to call a GRID that will be different depending on the parameter I pass. This is the function:
$JQuery(document).ready(function() {
$.ajax({
url: "/main/conciliacao/gera-colunas/tabela/<?php echo $tabela ?>",
success: function(data, st) {
criaGrid(data);
},
error: function() {
alert("Erro ao retornar os valores das colunas");
}
});
});
function criaGrid(colM) {
$JQuery("#jqGrid").jqGrid({
url: "/main/conciliacao/gera-grid/processo/<?php echo $processo ?>/tabela/<?php echo $tabela ?>/id/<?php echo $id ?>",
datatype: "json",
colModel: [ colM ],
viewrecords: true,
width: 780,
height: 200,
rowNum: 30,
pager: "#jqGridPager"
});
}
My problem is that the variable colM has what I need to create the grid columns, but if I call it in colModel: the function does not recognize the value of the variable.
What could be happening?