You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
4.1 KiB
JavaScript

var my_grid;//Grid对象
var my_pager;//分页控件对象
var page_count =15;//每页数据条数
var page_num =1;//当前页数默认为1
var page_total;//页面总数
/*******页面初始化加载Grid LWP 2012-10-13*******/
function initGrid()
{
my_grid = new dhtmlXGridObject('mygrid');
my_grid.setImagePath("../images/");
my_grid.setSkin("xp");
$("exceltitle").value="客户代码\t客户简称\t客户全称\t负责人\t联系电话\t传真\t结算方式\t销售\t录入人\t录入日期";
var array_Header = new Array("<input type='checkbox' id='ck_all' onclick=checkall() />","客户代码","客户简称","客户全称","负责人","联系电话","传真","结算方式","销售","录入人","录入日期");
var array_Width = new Array("40","120","120","120","120","120","120","120","120","120","120");
var array_Align = new Array("center","center","center","center","center","center","center","center","center","center","center");
var array_Sort = new Array("checkbox","str","str","str","str","str","str","str","str","str","str");
var array_type = new Array("ch","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro");
//
my_grid.setHeader(dotransition(array_Header));
my_grid.setInitWidths(dotransition(array_Width));
my_grid.setColAlign(dotransition(array_Align));
my_grid.setColSorting(dotransition(array_Sort));
my_grid.setColTypes(dotransition(array_type));
my_grid.init();
my_grid.load("CRM_ClientListSource.aspx?dotype=list&pagecount="+page_count+"&pagenum=1");
// setTimeout(function(){
// initPage();
// },300);
}
/*******传递查询条件参数 LWP 2012-10-13*******/
/*******加载当前页面数据 LWP 2012-10-13*******/
function initPage(){
my_pager = new PagerView('mypager');
var urlVal = "CRM_ClientListSource.aspx?dotype=page&pagecount="+page_count+"&pagenum="+page_num+"&clientname="+$("txtClientName").value+"&begindate="+$("txtBeginDate").value+"&enddate="+$("txtEndDate").value;
var loader = dhtmlxAjax.getSync(urlVal);
var loadVal = loader.xmlDoc.responseText;
page_total = loadVal;
my_pager.itemCount = page_total;
my_pager.size = page_count;
my_pager.index = page_num;
my_pager.onclick = function(index){
$('info').innerHTML = '现在翻到第' + index + '页';
my_grid = new dhtmlXGridObject('mygrid');
my_grid.setImagePath("../images/");
my_grid.setSkin("xp");
var array_Header = new Array("<input type='checkbox' id='ck_all' onclick=checkall() />","客户代码","客户简称","客户全称","负责人","联系电话","传真","结算方式","销售","录入人","录入日期");
var array_Width = new Array("40","120","120","120","120","120","120","120","120","120","120");
var array_Align = new Array("center","center","center","center","center","center","center","center","center","center","center");
var array_Sort = new Array("checkbox","str","str","str","str","str","str","str","str","str","str");
var array_type = new Array("ch","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro");
my_grid.setHeader(array_Header);
my_grid.setInitWidths(dotransition(array_Width));
my_grid.setColAlign(dotranstition(array_Align));
my_grid.setColSorting(dotranstition(array_Sort));
my_grid.setColTypes(dotranstition(array_type));
my_grid.init();
my_grid.load("CRM_ClientListSource.aspx?dotype=list&pagecount="+page_count+"&pagenum="+page_num+"&clientname="+$("txtClientName").value+"&begindate="+$("txtBeginDate").value+"&enddate="+$("txtEndDate").value,"json");
};
my_pager.render();
}
/*******进入子页面进行信息编辑 LWP 2012-10-13*******/
function createGrid()
{
this.mygrid_log.attachEvent("onRowDblClicked", function(rId,cInd)
{
// var selectedId = mygrid_log.getSelectedRowId();
// var URLs = "../shipping/ExchangesUnitEdit.aspx?handle=edit&id="+selectedId;//+qs.id;
// window.open(URLs,"_blank", "height=700, width=1024, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no,Top= " +(screen.height-700)/2 + ",Left= "+(screen.width-1024)/2);
});
}