// JavaScript Document
jQuery("#grid").jqGrid({
url:url,
datatype: "json",
width:1100,
height: 500,
colNames:['应用ID','应用名称', '正式开服数','全部开服数', '推荐页到达次数','选区页到达次数','登录次数','校验登录次数','转化率'],
colModel:[
{name:'appid',index:'appid', width:90,classes:'btn', align:"center",formatter:function(cellvalue, options, rowObject){
return '<a href="./index.php?c=top_apps&a=app_detail&appid='+cellvalue+'" title="点击查看此应用更多详细数据">'+cellvalue+'</a>'
}},
{name:'appname',index:'appname', width:90, align:"center", title:"点击查看此应用更多详细数据"},
{name:'run_server_count',index:'run_server_count', width:100,align:"center"},
{name:'all_server_count',index:'all_server_count', width:100,align:"center"},
{name:'index_count',index:'index_count', width:80, align:"center"},
{name:'selectserver_count',index:'selectserver_count', width:80, align:"center"},
{name:'login_count',index:'login_count', width:100,sorttype:"int", align:"center"},
{name:'checklogin_count',index:'checklogin_count', width:100,sorttype:"int", align:"center"},
{name:'crate',width:100,align:"center"},
],
rowNum:20,
rowList:[20,40,60],
pager: '#pager2',
sortname: 'login_count',
viewrecords: true,
sortorder: "desc"
});
jQuery("#grid").jqGrid('navGrid','#pager2',{edit:false,add:false,del:false});
gridComplete:function(){
//$("#list2").clearGridData(); //清楚数据
var data = $("#list2").getRowData(); //获取表格的当前页的所有数据
alert(data[0]['name']); 显示二位数据的第一个数组的name字段的值
}