js--删除数组元素(复选框数组)

1、//返回p_str在p_array数组中的位置 function indexOfArray(p_array, p_str) {  try {   for(var i=0;i 

2、调用splic()indexOfArray(p_array, p_str)实现删除某位置的元素

 function editZT(cell){  if (cell.innerText == '1'){   cell.innerHTML = ""  }  else  {    cell.innerHTML = ""  }   } function checkCode(obj){  jsdGrid.selectRow()  if(obj.checked) {    codevalue.push(jsdGrid.currentRow.c_bh)   }else{    codevalue.splice(indexOfArray(codevalue,jsdGrid.currentRow.c_bh),1)//删除数组元素    } } //全选 function checkAll(){   //jsdGrid.selectRow()   var bms = document.all.code   for (var i=0;i

 var data = jsdGrid.selectData("select c_bh bh from jy_jsd_cw where c_month = '"+month+"' and c_jslx = '"+jslx+"' and c_jsdx = '"+jsdx+"' and n_zt<>1",null,true)   if(document.all.code1.checked==true){    for(i in data){     codevalue.push(data[i].bh)           }   }else{   for(i in data){    codevalue.splice(indexOfArray(codevalue,data[i].bh),1)    }    } }

你可能感兴趣的:(function,input,null,c)