zoukankan      html  css  js  c++  java
  • easyui 传递参数报错(错误:uncaught SyntaxError: Unexpected identifier)

    转自:https://www.cnblogs.com/javaboy2018/p/8733585.html

    代码:

    按钮事件:

    function formatOper(val, row, index) {
        var $row = JSON.stringify(row).replace(/"/g,"'");//row的是一个对象
        return '<a href="javascript:void(0)" class="editCabinet"  onclick="editInfo('+$row+')"></a><a href="javascript:void(0)" class="delCabinet" onclick="deleteInfo('+$row+')"></a>';
    };

    接收:

    //修改
    function editInfo(row){
        $('#addForm').form('load',{'infoGatewayIp.ip':row.ip,"infoGatewayIp.describe":row.ipDescribe,
            "infoGatewayIp.alarmValue":row.alarmValue,"infoGatewayIp.isMonitor":row.isMonitor,
             "infoGatewayIp.isEmail":row.isEmail,"infoGatewayIp.remark":row.remark,"id":row.id});
        $('#titledialogs').dialog('open').dialog({
            title:'修改网关配置',
            iconCls: 'icon-save',
            buttons: [
                      {
                          text: '保存',
                          iconCls:'icon-ok',
                          handler: function(){
                        $.messager.confirm('系统提示', '您确定要修改吗?', function(r){
                            if (r) {
                                var alarmValue = $("#alarmValue").val().trim();
                                if(alarmValue < 0 || alarmValue > 100 || !alarmValue.match(/[0-9]+/) || !/^d+$/.test(alarmValue)){
                                     $.messager.alert('系统提示', '报警值请输入0~100的整数', 'info');
                                     return;
                                 }
                                  $("#searchIp").textbox('setValue',$("#addIp").val().trim());
                                  $('#addForm').form('submit', {
                                      url: 'report/updateInfoGateway.action',
                                      onSubmit: function(){
                                          var isValid = $(this).form('validate');
                                          if (!isValid){
                                              $.messager.progress('close');    
                                          }
                                          return isValid;    
                                      },
                                      success: function(data){
                                          $.messager.progress('close');
                                          $.messager.alert('系统提示', data, 'info');
                                          if(data.indexOf('成功') >= 0){
                                              $('#titledialogs').dialog('close');
                                              var ip = $("#searchIp").val().trim();
                                              if (ip.length == 0) {
                                                  ip = '';
                                              }
                                              loaddata(ip,1);
                                          }
                                      }
                                  });
                                }
                            });
                                  }
                          },
                          {
                              text: '取消',
                              iconCls:'icon-cancel',
                              handler: function(){
                                  $('#titledialogs').dialog('close');
                              }
                          }
                      ]
            });
    }
  • 相关阅读:
    python基础—函数装饰器
    python基础—函数嵌套与闭包
    Python之三级菜单
    Python之运算符
    Python之字典
    Python之购物车
    Python之列表
    Python之布尔
    Python之“Hello World”
    Python之递归函数
  • 原文地址:https://www.cnblogs.com/raitorei/p/10641174.html
Copyright © 2011-2022 走看看