- <et:gridcolumn field="PKID" format="<input type='checkbox' value='{0}' name='item' onclick='checkin();' />"
- <input type="checkbox" id='chkAll' onclick="selectall();checkin();" />
- </et:gridcolumn>
- <div>
- <input type="button" value="删除" onclick="deleteCandidates($('#pkids').val())" />
- <input type="text" id="pkids" />
- </div>
- //selectall与checkin两个函数实现全选
- function selectall() {
- var value=$("#chkAll").attr("checked");
- var chk=$("[name='item']");
- chk.attr("checked",value);
- }
- function checkin() {
- var chk=$("[name='item']");
- if(chk.length!=0){
- var i=0;
- str="";
- $('[name="item"]').each(function(){
- if($(this).attr("checked")==true){
- str+=($(this).val()+",");
- i++;
- }
- });
- $("#pkids").val(str.substr(0,str.length-1));
- if(chk.length==i){
- $("#chkAll").attr("checked","true");
- }
- else{
- $("#chkAll").removeAttr("checked");
- }
- }
- else{
- alert("无简历信息!未选中任何简历!");
- $("#chkAll").removeAttr("checked");
- }
- }
- function doquery(){
- var grid=$("#grid1");
- grid.reloadgrid();
- }
- function deleteCandidates(pkids){
- if (confirm("确定要删除所选记录吗?")){
- $.json({__dll:dll,__method:'Recruit.Db.Candidate.DeleteCandidates',__ASYNC:false,'pkids':pkids},function (text) {
- if (text!="") {alert(text);}
- else {doquery();}
- });
- }
- }