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.LIKEledmc = $('#LIKEledmc').textbox("getValue");
//	sParam.startTime = startTime;
//	sParam.endTime = endTime;
    sParam.order = " order by ledmc"

    return sParam;
}

//加载列表
function initGrid() {
    var toolbar = [{
        text: '查询',
        iconCls: 'icon-search',
        handler: doSearch
    }];
    $('#tableGrid').datagrid({
        toolbar: toolbar,
        singleSelect: true,
        rownumbers: true,
        queryParams: getQueryParams(),
        url: 'nhywjtledydpglAction!listNhywjtledydpglByPage.do',
        columns: [[
            {
                field: 'A',
                checkbox:'true',
                width:30
            },
            {field: 'xh', title: '编码', hidden: true, width: 120},
            {field: 'ledmc', title: 'led名称', hidden: false, width: 120},
            {
                field: 'ledbh', title: 'led编号', hidden: false, width: 120,

            },
            {field: 'pp', title: '品牌', hidden: false, width: 120},
            {field: 'ggxh', title: '规格型号', hidden: false, width: 120},
            {field: 'qybh', title: '区域编号', hidden: false, width: 120},
            {field: 'qymc', title: '区域名称', hidden: false, width: 120},
            {field: 'lkh', title: '路口号', hidden: false, width: 120},
            {field: 'lkmc', title: '路口名称', hidden: false, width: 120},

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

