<script type="text/javascript" language="javascript" >
......................................
jQuery(document).ready(function() {
var contexPath = "<%=request.getContextPath() %>";
var mydata=[];
mydata.splice(0,mydata.length); //clean array
// Add items at a later time to the array using push
for(var i=0;i<data.length;i++){
yourMessage = data[i];
//alert(yourMessage.dateprogram_vis);
mydata.push( {account_vis: yourMessage.account_vis ,
dateprogram_vis: yourMessage.dateprogram_vis,
visit_vis: yourMessage.visit_vis,
datevis_vis: yourMessage.datevis_vis,
captured_vis: yourMessage.captured_vis,
datecaptured_vis: yourMessage.datecaptured_vis,
type_vis: yourMessage.type_vis,
totadebt: yourMessage.totadebt,
lastdebt: yourMessage.lastdebt,
range_vis: yourMessage.range_vis
});
}
jQuery("#gridAcc").GridUnload(); //reconstruye grid
jQuery("#gridAcc").setGridParam({ 'data': mydata }).trigger("reloadGrid"); //reload grid con nuevos datos
jQuery("#gridAcc").jqGrid({
data: mydata,
datatype: "local",
height: 250,
width: 650,
rowNum: 10,
rowList: [10,20,30],
colNames:[
'account',
'fecha prog vis',
'num de visitas',
'fecha visita',
'captured_vis',
'fecha captura',
'tipo visita',
'total deuda',
'lastdebt_vis',
'rango vis'
],
colModel:[
{name:'account_vis',index:'account_vis', width:60, sorttype:"text", align:"center"},
{name:'dateprogram_vis',index:'dateprogram_vis', width:90, sorttype:"date", align:"center", formatter:'date', formatoptions: {newformat:'d/m/Y'}, datefmt: 'd/m/Y'},
{name:'visit_vis',index:'visit_vis', width:90, sorttype:"text", align:"center"},
{name:'datevis_vis',index:'datevis_vis',width:90,sorttype:"date", align:"center",formatter:'date', formatoptions: {newformat:'d/m/Y'}, datefmt: 'd/m/Y'},
{name:'captured_vis',index:'captured_vis',width:60,sorttype:"text", align:"center"},
{name:'datecaptured_vis',index:'datecaptured_vis',width:90, sorttype:"date",align:"center",formatter:'date', formatoptions: {newformat:'d/m/Y'}, datefmt: 'd/m/Y'},
{name:'type_vis',index:'type_vis',width:90,sorttype:"text", align:"center"},
{name:'totadebt',index:'totadebt',width:100,sorttype:"text", align:"center"},
{name:'lastdebt',index:'lastdebt',width:100,sorttype:"text", align:"center"},
{name:'range_vis',index:'range_vis',width:50,sorttype:"text", align:"center"}
],
shrinkToFit:false,
altRows:true,
pager: '#pager',
viewrecords: true
});
jQuery("#gridAcc").jqGrid('navGrid','#pager',{edit:false,add:false,del:false,search:false});
//jQuery("#info").html(myCols[3].city).slideDown('slow');