﻿/*
此文件为前后台公用脚本文件
*/
/*
CheckAllOrNot:全选/反选
objChkAll:全选按钮对象
gridViewID:gridView控件的ClientID
checkBoxIDSvr:服务端checkbox的ID
*/
function CheckAllOrNot(objChkAll,gridViewID,checkBoxIDSvr) {
    var gv = document.getElementById(gridViewID);
    for (i = 1; i < gv.rows.length; i++) {
        var inputArray = gv.rows[i].getElementsByTagName("input");
        for (var j = 0; j < inputArray.length; j++) {
            if (inputArray[j].type == 'checkbox') {
                if (inputArray[j].id.indexOf(checkBoxIDSvr, 0) > -1) {
                    inputArray[j].checked = objChkAll.checked;
                    if (typeof (GridViewRowCheck) == 'function')
                        GridViewRowCheck(inputArray[j], i);//触发每个checkbox事件
                }
            }
        }
    }
}
