Home Web Front-end JS Tutorial Summary of EasyUI development skills

Summary of EasyUI development skills

Jan 31, 2018 pm 02:17 PM
easyui develop Summarize

This article mainly introduces relevant information about the summary of jQuery EasyUI development skills. I hope that through this article, everyone can master the development skills of EasyUI. Friends who need it can refer to it. I hope it can help everyone.

jQuery EasyUI development skills summary

1. When using tabs, if you use content instead of url, you must embed iframe


1

2

3

4

5

addTab({

        title:node.text,

        closeable:true,

        content:‘<iframe src="'+url+'" frameborder="0" style="border:0;width:100%;height:99%"></iframe>

   });

Copy after login

1) External call to the tag content inside the iframe


1

<button onclick="console.info($('iframe').contents().find('#frameId'));"/>

Copy after login

2) Internal call External method:


1

onclick="parent.getData();"

Copy after login

2. Query submission form:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

function serarchFun(){//搜索

  $("#datagrid").datagrid("load", serializeObject($("#searchForm")));

}

function cleanFun(){//清空

  $("#searchForm input").val('');

  $("#datagrid").datagrid("load", {});

}

 

function removeFun(){//删除

  var rows=$("#datagrid").datagrid("getChecked");

  var ids[] = new Array();

  if(rows.length>0){

    for(var i=0;i<rows.length;i++){

      ids.push(row[i].id);

    }

    $.ajax({

      url:'${rootPath}/user_delete.action',

      data:{ids:ids.join(',')},

      dataType:'json',

      success:function(data){

        $('#datagrid').datagrid('load');

        $('#datagrid').datagrid('unselectAll');

        $.messager.Show({

          title:'提示',

          msg:data.msg

        });

      }

    })

  }else{

    $.messager.Show({

      title:'提示',

      msg:'不能删除'

    });

  }

}

Copy after login

3. Add checkbox:


##

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

$("#datagrid").datagrid(

 

  url:"${rootPath}/user_add.action",

  idField:'id',

  checkOnSelect:false,

  selectOnCheck:true,//选中复选框选中

  frozonColumns:[[{

    field:'id',

    title:'编号',

    width:150,

    checkbox:true

    },{

    field:'name',

    title:'登陆名称',

    width:150,

    sortable:true

  }]],

  columns:[[{

    field:'pwd',

    title:'密码',

    width:150,

    formatter: function(){

      return:"****************"

    }

  }]]

);

Copy after login

4. Confirmation dialog box:


1

2

3

4

5

$.messager.confirm('确认','你真的要删除吗?',function(data){

  if(data){

 

  }

});

Copy after login

5. Edit to implement dynamic loading of the page

##

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

function editFun(){

var rows=$("#datagrid").datagrid("getChecked");

  $('<p/>').dialog({

    width:500,

    height:200,

      href:'${rootPath}/edit.jsp,

      modal:true,

      title:'编辑用户',

      buttons:[{

        text:编辑,

        handler:function(){

            $('#editForm').form('submit',{

              url:'${rootPath}/user_edit.action',

              success:function(data){

                var obj = JQuery.parseJSON(data);

                if(obj.success){

                  $('#edit_dialog').dialog('close');

                }

                $.messager.show({

                  title:'提示',

                  msg:obj.msg

                });

              }

            }

        }

      }],

      onClose:function(){//必须写的

        $(this).dialog('destroy');

      },

      onOpen:function(){

        var data = rows[0];

      },

      onLoad:function(){//初始化数据,填充数据

        var data = rows[0];

        $("#editForm").form("load", data);

      }

  });

}

Copy after login

6. Update row


1

2

3

4

5

var rows=(‘#datagrid').datagrid(‘getChecked');(‘#datagrid').datagrid(‘updateRow',{

index:$(‘#datagrid').datagrid(‘getRowIndex',rows[0]),

row:result.obj

 

});

Copy after login

Related recommendations:


Develop the use of attachment upload component uploadify based on MVC4+EasyUI

The above is the detailed content of Summary of EasyUI development skills. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Four recommended AI-assisted programming tools Four recommended AI-assisted programming tools Apr 22, 2024 pm 05:34 PM

Four recommended AI-assisted programming tools

Which AI programmer is the best? Explore the potential of Devin, Tongyi Lingma and SWE-agent Which AI programmer is the best? Explore the potential of Devin, Tongyi Lingma and SWE-agent Apr 07, 2024 am 09:10 AM

Which AI programmer is the best? Explore the potential of Devin, Tongyi Lingma and SWE-agent

Learn how to develop mobile applications using Go language Learn how to develop mobile applications using Go language Mar 28, 2024 pm 10:00 PM

Learn how to develop mobile applications using Go language

Summary of the five most popular Go language libraries: essential tools for development Summary of the five most popular Go language libraries: essential tools for development Feb 22, 2024 pm 02:33 PM

Summary of the five most popular Go language libraries: essential tools for development

Summarize the usage of system() function in Linux system Summarize the usage of system() function in Linux system Feb 23, 2024 pm 06:45 PM

Summarize the usage of system() function in Linux system

Understanding VSCode: What is this tool used for? Understanding VSCode: What is this tool used for? Mar 25, 2024 pm 03:06 PM

Understanding VSCode: What is this tool used for?

Is PHP front-end or back-end in web development? Is PHP front-end or back-end in web development? Mar 24, 2024 pm 02:18 PM

Is PHP front-end or back-end in web development?

Exploring Go language front-end technology: a new vision for front-end development Exploring Go language front-end technology: a new vision for front-end development Mar 28, 2024 pm 01:06 PM

Exploring Go language front-end technology: a new vision for front-end development

See all articles