var windowId,proName = window.location.pathname.split("/")[1],sysUrl = "http://"+window.location.host+"/"+proName,toEdit;
var num=0;
$(function(){
	initGrid();
});
//查询条件
function getQueryParams(){
	var sParam = {};
	sParam.LIKEmachinename = $('#LIKEmachinename').textbox("getValue");
	sParam.order = "order by createtime desc "
	return sParam;
}
//加载列表
function initGrid(){	
	var toolbar = [
	{
    	text	:	'查询',
        iconCls	:	'icon-search',
        handler	:	doSearch
    }];
	$('#tableGrid').datagrid({
		toolbar : toolbar,
		singleSelect:true,
		rownumbers:true,
		queryParams:getQueryParams(),
		url : 'ywmachineinfoAction!listYwmachineinfoByPage.do',
		columns : [[
		    {
				field: 'A',
				checkbox:'true',
				width:30
			},
		    {field:'machineid',title:'machineid',hidden:true,width:120, 
				formatter:function showClick(value,record,num){ 
					return "<a  href='javascript:void(0);' class='ahref' onclick='doUpdate("+num+")'>"+value+"</a>";
				}
 			},
			{field:'machinename',title:'服务器名称',hidden:false,width:120},
			{field:'machineip',title:'服务器ip',hidden:false,width:100},
			{field:'csmc',title:'是否启用',hidden:false,width:80}
		]]
	});
}


//查询
function doSearch(){	
	$('#tableGrid').datagrid('load',getQueryParams());
}


