var windowId, proName = window.location.pathname.split("/")[1],
    sysUrl = "http://" + window.location.host + "/" + proName, toEdit;
$(function () {
    initDefault();
});

//默认
function initDefault() {

    initGrid();
}

//查询条件
function getQueryParams() {
    var sParam = {};
//	var startTime = $('#startTime').datetimebox("getValue");	
//	var endTime = $('#endTime').datetimebox("getValue");

    sParam.LIKExhdmc = $('#LIKExhdmc').textbox("getValue");
    sParam.LIKElkmc = $('#LIKElkmc').textbox("getValue");
    sParam.LIKEqymc = $('#LIKEqymc').textbox("getValue");
//	sParam.startTime = startTime;
//	sParam.endTime = endTime;
//	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: 'nhywjtxhdglAction!listNhywjtxhdglByPage.do',
        columns: [[
            {
                field: 'A',
                checkbox:'true',
                width:30
            },
            {field: 'xhdmc', title: '信号灯名称', hidden: false, width: 120},
            {field: 'xhdbh', title: '信号灯编号', hidden: false, width: 120},
            {field: 'qymc', title: '区域名称', hidden: false, width: 120},
            {field: 'lkmc', title: '路口名称', hidden: false, width: 120}
        ]]
    });
}


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


