要求分数和排序两列能编辑
//查询该试卷题型的试题 $('#allList1').datagrid({ url:app.approot+"paperRes/getPaperQuestionList/"+ptyid, handler:function(){ //接受改变的值 $('#allList1').datagrid('acceptChanges'); }, onBeforeEdit: function (rowIndex,rowData) { $("#selQuestionId").val(rowData.questionId); }, onClickCell: onClickCell, onAfterEdit:function(rowIndex, rowData, changes){ // 第三个参数是改变的值 // alert(changes.scoreItem); if(changes.questionNo!=undefined&&changes.questionNo!='undefined'){ $.post(app.approot+'paperRes/updateQuestionNo/'+rowData.paperId+ '/'+rowData.questionId+'/'+changes.questionNo,function(result){ if(result.msgid=="1"){ $('#allList1').datagrid('reload'); }else{ $.messager.alert("操作提示",result.msg,"info"); } },"json"); } if(changes.scoreItem!=undefined&&changes.scoreItem!='undefined'){ $.post(app.approot+'paperRes/updateQuestionScoreItem/'+rowData.paperId+ '/'+rowData.questionId+'/'+changes.scoreItem,function(result){ if(result.msgid=="1"){ $('#allList1').datagrid('refreshRow', rowIndex); }else{ $.messager.alert("操作提示",result.msg,"info"); $('#allList1').datagrid('reload'); } },"json"); } } });