[劉陽Java]_easyui-panel組件入門級_第3講

來源:互聯網
上載者:User

標籤:實現   json   body   ble   height   添加   data   事件   java   

EasyUI中的panel組件在前面一節中我們簡單告訴了大家代碼如何寫。這一節我們會從panel的入門級開始講起走,重點包括它的事件監聽,屬性tool介紹

1. 事件監聽-通過data-options方式實現

<div class=”easyui-panel” data-options=”width…..” data-options=”onCollapse:function() {console.log(‘Hello Wrold’);}”>

 

2. 事件監聽-通過JS建立組件並定義事件監聽

<script type="text/javascript">    $(function() {        $("#d01").panel({            width: 500,            height: 200,            iconCls: ‘icon-save‘,            collapsible: true,            title: ‘我的面板‘,            onCollapse: function() {                console.log(‘Hello World‘);            }        });            });</script><div id="d01">    我的第一個easyui程式</div>

3. easyui-panel組件擴充,主要使用tools

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Insert title here</title><!-- 1.引入jquery.min.js2.引入jquery.easyui.min.js3.引入jqueryeasyui的css4.引入國際化資源檔EasyUI建立組件有兩種方式1.html方式建立(推薦使用data-options方式來添加組件屬性, data-options方式是html5)2.js方式建立, 屬性的添加是一種json格式風格 --><script type="text/javascript" src="../easyui/jquery.min.js"></script><script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script><link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css"><link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css"><script type="text/javascript" src="../easyui/locale/easyui-lang-zh_CN.js"></script></head><body><div class="easyui-panel" style="width:500px;height:200px;padding:10px;" data-options="iconCls:‘icon-save‘,collapsible:true,title:‘我的面板‘,tools:‘#tt‘">    我的第一個easyui程式</div><div id="tt">    <a href="#" class="icon-add" onclick="javascript:alert(‘icon-add‘);"></a>    <a href="#" class="icon-edit" onclick="javascript:alert(‘icon-edit‘);"></a></div></body></html>

 

[劉陽Java]_easyui-panel組件入門級_第3講

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.