Categories
- FFMpeg (5)
- Libav (1)
- Google (3)
- iBeacon (1)
- LDAP (3)
- Me (2)
- Network (11)
- OS (149)
- RTMP (4)
- SIP (1)
- Kamailio (1)
- SNMP (1)
- VMware (20)
- VCP考試 (1)
- 伺服器 網站服務 (105)
- 名詞解釋 (4)
- 專案管理 (1)
- 工具軟體 (50)
- Adobe (1)
- FMS (1)
- Cloudera (1)
- Docker (1)
- Eclipse (4)
- Intellij (2)
- OBS (2)
- Office (10)
- Excel (4)
- PowerPoint (5)
- Postman (1)
- Splunk (13)
- Virtualbox (2)
- Visual Studio (2)
- 文字編輯器 (10)
- Sublime Text 2 (6)
- Sublime Text 3 (3)
- Vim (3)
- 連線工具 (1)
- Xshell (1)
- Adobe (1)
- 程式語言 (79)
- CSS (2)
- HTML (2)
- iOS (1)
- Java (30)
- JavaScript (5)
- jQuery (4)
- jsTree (2)
- JSP (3)
- PHP (16)
- Python (7)
- Ruby (1)
- sed (1)
- Shell Script (8)
- Windows Bash Script (1)
- XML (1)
- 資料庫 (37)
- FFMpeg (5)
Category Archives: jQuery
[jsTree] Populating the tree using JSON
Using Json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
$('#using_json').jstree({ 'core' : { 'data' : [ 'Simple root node', { 'text' : 'Root node 2', 'state' : { 'opened' : true, 'selected' : true }, 'children' : [ { 'text' : 'Child 1' }, 'Child 2' ] } ] } }); |
Using the alternative JSON format
1 2 3 4 5 6 7 8 9 |
$('#using_json').jstree({ 'core' : { 'data' : [ { "id" : "ajson1", "parent" : "#", "text" : "Simple root node" }, { "id" : "ajson2", "parent" : "#", "text" : "Root node 2" }, { "id" : "ajson3", "parent" : "ajson2", "text" : "Child 1" }, { "id" : "ajson4", "parent" : "ajson2", "text" : "Child 2" }, ] } }); |
Ref. Populating the tree using JSON
Posted in jsTree
Leave a comment
[jsTree] Expand and collapse buttons.
1 2 3 |
<input type="button" value="Expand All" onclick="$(‘#jsTreeID').jstree('open_all');"> <input type="button" value="Collapse All" onclick="$('#jsTreeID').jstree('close_all');"> |
Ref: jsTree: adding Expand All and Collapse All buttons
Posted in jsTree
Leave a comment
[JavaScript][jQuery] How to enable/disable select field?
[jQuery]
1 2 3 4 5 6 7 8 9 10 |
$('input[type=radio][name=ldap-sync-type]').change(function() { if (this.value == '0') { $("select[name=day-option]").prop("disabled", true); $("select[name=clock-option]").prop("disabled", true); } else if (this.value == '1') { $("select[name=day-option]").prop("disabled", false); $("select[name=clock-option]").prop("disabled", false); } }); |
[JavaScript]
1 2 3 4 5 6 7 8 9 10 |
$('input[type=radio][name=ldap-sync-type]').change(function() { if (this.value == '0') { $("select[name=day-option]").attr("disabled", "disabled"); $("select[name=clock-option]").attr("disabled", "disabled"); } else if (this.value == '1') { $("select[name=day-option]").removeAttr("disabled"); $("select[name=clock-option]").removeAttr("disabled"); } }); |
Posted in JavaScript, jQuery
Leave a comment
jQuery Tablesorter
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 39 40 41 42 43 44 45 46 47 |
<html> <head> <link rel="stylesheet" href="theme/style.css" type="text/css" id="" media="print, projection, screen" /> <script type="text/javascript" src="jquery.tablesorter.js"></script> <script type="text/javascript"> $(function() { $("table").tablesorter({ //是否開啟debug模式,在console端顯示 //debug: true, widgets: ['zebra'], widthFixed: false, headers:{ //預設情況下,會自動parser每一欄資料的屬性,但是也有可能會變是錯誤導致無法排序 //第一欄資料屬性強制設為text 0: { sorter: "text" }, //關閉第三欄的排序功能 2: { sorter: false } }, //預設排序方式為第一欄,升冪 sortList: [[0,0]] }); }); </script> </head> <body> <div data-role="main" class="ui-content"> <table id = "tablePads" class = "tablesorter" cellspacing="0" BORDER="0"> <thead> <tr> <th style="text-align:center">Pad Name</th> <th style="text-align:center">Last Edit Date</th> <th style="text-align:center">Active</th> </tr> </thead> <tbody> <?php 取資料的迴圈;?> <tr id="Pad<%=i%>"> <td>資料1</td> <td>資料2</td> <td>資料3</td> </tr> <?php } ?> </tbody> </table> </div> </body> </html> |
Posted in jQuery
Leave a comment