分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

关于easyUI的一些js方法

发布时间:2023-09-06 01:45责任编辑:赖小花关键词:js

1.

$("#dg").datagrid("load",{
"userName":$("#s_userName").val()
});

数据表的load方法,用于加载数据,后面可以写上参数,格式为:{"参数名":参数值,"":""}中间用逗号分开

2.$("#dlg").dialog("open").dialog("setTitle","添加用户信息");

可以打开对话框的方法,后面是设置标题

3.$("#dg").datagrid("getSelections");

获取数据表中选中的行

4.$.messager.alert("系统提示", "请选择一条要编辑的数据!");

easyui 的 alert方法

5.

$("#fm").form("submit",{
  url:url,
  onSubmit:function(){
    if($("#roleName").combobox("getValue")==""){
      $.messager.alert("系统提示","请选择用户角色!");
      return false;
    }
    return $(this).form("validate");
  },
  success:function(result){
    var result=eval(‘(‘+result+‘)‘);
     if(result.success){
      $.messager.alert("系统提示","保存成功!");
      resetValue();
      $("#dlg").dialog("close");
      $("#dg").datagrid("reload");
     }else{
      $.messager.alert("系统提示","保存失败!");
     }
  }
});

easyUI提交表单的方法

6.$("#dlg").dialog("close");

关闭对话框

7.

$.messager.confirm("系统提示","您确定要删除这<font color=red>"+selectedRows.length+"</font>条数据吗?",function(r){
if(r){
$.post("${pageContext.request.contextPath}/user/delete.do",{ids:ids},function(result){
if(result.success){
$.messager.alert("系统提示","数据已成功删除!");
$("#dg").datagrid("reload");
}else{
$.messager.alert("系统提示","数据删除失败,请联系系统管理员!");
}
},"json");

});

easyui $.post方法一定要指定为json格式,否则后台传来的数据无法解析

https://www.cnblogs.com/prefect/p/5664462.html

关于easyUI的一些js方法

原文地址:https://www.cnblogs.com/dotnetmvc/p/8531117.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved