zoukankan      html  css  js  c++  java
  • easyui datagrid 单元格编辑保存

    要求分数和排序两列能编辑

        //查询该试卷题型的试题
        $('#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");  
              }
           
            }
    
            });
  • 相关阅读:
    判断DataSet为空
    msxml3.dll 错误 '800c0008'
    google Map api地理位置坐标转换
    C# .net中cookie值为中文时的乱码解决方法
    windows pear 安装
    smarty2 设置、变量、函数
    简单模板类
    mysql 1366 插入错误
    Oracle修改账户口令
    C# Winform验证码
  • 原文地址:https://www.cnblogs.com/dingding0505/p/4250846.html
Copyright © 2011-2022 走看看