|
|
|
|
var commonGridObj_user;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function initWinScreen()
|
|
|
|
|
{
|
|
|
|
|
var winScreenHeight = 0;
|
|
|
|
|
var winScreenWidth = 0;
|
|
|
|
|
if(window.screen.height)
|
|
|
|
|
{
|
|
|
|
|
winScreenHeight = window.screen.height;
|
|
|
|
|
}
|
|
|
|
|
if(window.screen.width)
|
|
|
|
|
{
|
|
|
|
|
winScreenWidth = window.screen.width;
|
|
|
|
|
}
|
|
|
|
|
if(winScreenWidth >= 1440 && winScreenWidth >= 900)
|
|
|
|
|
{
|
|
|
|
|
document.getElementById("mygrid_container_user").style.height = "420px";
|
|
|
|
|
}
|
|
|
|
|
else if(winScreenWidth >= 1366 && winScreenWidth >= 768)
|
|
|
|
|
{
|
|
|
|
|
document.getElementById("mygrid_container_user").style.height = "340px";
|
|
|
|
|
}
|
|
|
|
|
else if(winScreenWidth >= 1024 && winScreenWidth >= 768)
|
|
|
|
|
{
|
|
|
|
|
document.getElementById("mygrid_container_user").style.height = "300px";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function createGrid()
|
|
|
|
|
{
|
|
|
|
|
var headerArgs_user = new Array("<input type=\"checkbox\" id=\"ck_all\" onclick=\"checkAll(commonGridObj_order)\" />","代码","姓名","所属分公司","所属部门","联系电话","传真");
|
|
|
|
|
var widthArgs_user = new Array("50","50","100","100","100","100","100");
|
|
|
|
|
var colAlignArgs_user = new Array("center","center","center","center","center","center","center");
|
|
|
|
|
var colSortArgs_user = new Array("na","str","str","str","str","str","str");
|
|
|
|
|
var colTypeArgs_user = new Array("ch","ro","ro","ro","ro","ro","ro");
|
|
|
|
|
|
|
|
|
|
commonGridObj_user = new TGridCommon("mygrid_container_user","form1",headerArgs_user,widthArgs_user,colAlignArgs_user,colSortArgs_user,colTypeArgs_user);
|
|
|
|
|
commonGridObj_user.setResponseUrl("UserGridSource.aspx");
|
|
|
|
|
commonGridObj_user.setRequest("UserGridSource.aspx?handle=list");
|
|
|
|
|
commonGridObj_user.setSourceType("json");
|
|
|
|
|
commonGridObj_user.setSkin("xp");
|
|
|
|
|
commonGridObj_user.setImageUrl("../images/");
|
|
|
|
|
commonGridObj_user.initGrid();
|
|
|
|
|
commonGridObj_user.bind();
|
|
|
|
|
|
|
|
|
|
commonGridObj_user.getGridObj().attachEvent("onEditCell",function(stage,rId,cInd,nValue,oValue)
|
|
|
|
|
{
|
|
|
|
|
if(stage == 0)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
commonGridObj_user.getGridObj().attachEvent("onRowDblClicked", function(id,ind)
|
|
|
|
|
{
|
|
|
|
|
var rId = commonGridObj_user.getGridObj().getSelectedRowId();
|
|
|
|
|
var openSet = "height=768, width=1024, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no,Top= " +(screen.height-710)/2 + ",Left= "+(screen.width-800)/2
|
|
|
|
|
var openType = "_blank";
|
|
|
|
|
var openUrl = "Edit.aspx?id="+rId+"&handle=edit";
|
|
|
|
|
window.open (openUrl,openType,openSet);
|
|
|
|
|
});
|
|
|
|
|
}
|