關於easyUI的一些js方法

來源:互聯網
上載者:User

標籤:

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格式,否則後台傳來的資料無法解析

關於easyUI的一些js方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.