From e502f8072812127c1de3d1add447ca78d0ddccdc Mon Sep 17 00:00:00 2001 From: qixinzhi Date: Thu, 18 Nov 2021 15:13:17 +0800 Subject: [PATCH 1/7] * beautify scroll bar for task/bug/story card --- module/bug/css/x.view.css | 6 +++++- module/story/css/x.view.css | 6 +++++- module/task/css/x.view.css | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/module/bug/css/x.view.css b/module/bug/css/x.view.css index f60657557c..4a074cb3f2 100644 --- a/module/bug/css/x.view.css +++ b/module/bug/css/x.view.css @@ -1,7 +1,11 @@ .main-actions {display: none;} -#main {margin-bottom: 40px;} +#main {margin-bottom: 40px;min-width: unset;} #mainMenu .pull-left>a {display: none;} #mainMenu .pull-left .divider {display: none;} #mainMenu .pull-right {display: none;} #mainContent .col-4 {display: none;} .modal-dialog {width: 90%;} +::-webkit-scrollbar {width: 10px;height: 10px;} +::-webkit-scrollbar-thumb:vertical {box-shadow: inset 1px 1px 0 rgb(0 0 0 / 10%), inset 0 -1px 0 rgb(0 0 0 / 7%);background-color: rgba(0, 0, 0, 0.2);border-radius: 10px;opacity: 0;transition: opacity 0.1s;} +.m-bug-view:hover{overflow: overlay;} +.m-bug-view{overflow: hidden;} \ No newline at end of file diff --git a/module/story/css/x.view.css b/module/story/css/x.view.css index 7714760a97..6f0e93975b 100644 --- a/module/story/css/x.view.css +++ b/module/story/css/x.view.css @@ -2,7 +2,11 @@ #mainMenu .pull-left .divider {display: none;} #mainMenu .pull-right {display: none;} #mainContent .col-4 {display: none;} -#main {margin-bottom: 40px;} +#main {margin-bottom: 40px;min-width: unset;} .main-actions {display: none;} .col-8>.cell {min-height: 300px;} .modal-dialog {width: 90%;} +::-webkit-scrollbar {width: 10px;height: 10px;} +::-webkit-scrollbar-thumb:vertical {box-shadow: inset 1px 1px 0 rgb(0 0 0 / 10%), inset 0 -1px 0 rgb(0 0 0 / 7%);background-color: rgba(0, 0, 0, 0.2);border-radius: 10px;opacity: 0;transition: opacity 0.1s;} +.m-story-view:hover{overflow: overlay;} +.m-story-view{overflow: hidden;} diff --git a/module/task/css/x.view.css b/module/task/css/x.view.css index 8ba1bad35c..02ef2078db 100644 --- a/module/task/css/x.view.css +++ b/module/task/css/x.view.css @@ -2,7 +2,11 @@ #mainMenu .pull-left .divider {display: none;} #mainMenu .pull-right {display: none;} #mainContent .col-4 {display: none;} -#main {margin-bottom: 40px;} +#main {margin-bottom: 40px;min-width: unset;} .main-actions {display: none;} .col-8 > .cell {min-height: 300px;} .modal-dialog {width: 90%;} +::-webkit-scrollbar {width: 10px;height: 10px;} +::-webkit-scrollbar-thumb:vertical {box-shadow: inset 1px 1px 0 rgb(0 0 0 / 10%), inset 0 -1px 0 rgb(0 0 0 / 7%);background-color: rgba(0, 0, 0, 0.2);border-radius: 10px;opacity: 0;transition: opacity 0.1s;} +.m-task-view:hover{overflow: overlay;} +.m-task-view{overflow: hidden;} \ No newline at end of file From 5d7ae6a71baed4c7da0c00a0cb690223f110338c Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 19 Nov 2021 10:06:56 +0800 Subject: [PATCH 2/7] * Fix bug #16467. --- module/product/js/browse.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/module/product/js/browse.js b/module/product/js/browse.js index 1a72c742f3..57b1a6833c 100644 --- a/module/product/js/browse.js +++ b/module/product/js/browse.js @@ -112,8 +112,19 @@ $(function() }); if($("main").is(".hide-sidebar")) $("#sidebarHeader").hide(); + var isClickStoryToggle = false; + $(".story-toggle").click(function() + { + isClickStoryToggle = true; + }); + /* Shift key selection. */ + var isClickStoryToggle = false; var lastStorySelected = ''; + $(".story-toggle").click(function() + { + isClickStoryToggle = true; + }); $("#storyList tbody").on("click","tr",function(e) { var nowCheckbox = $(this)['context'].cells[0].childNodes[0].childNodes[0]; @@ -131,14 +142,16 @@ $(function() $(this)['context'].checked = $(this)['context'].checked || (isStartStorySelected && !isEndStorySelected) ? true : false; isStartStorySelected = nowStorySelected == $(this).val() || lastStorySelected == $(this).val() || isStartStorySelected ? true : false; + + if(isEndStorySelected) return; }); } } - else + else if(!isClickStoryToggle) { lastStorySelected = nowCheckbox.value; } - + isClickStoryToggle = false; }); }); From c38383ad409d208a3ab0f953134da7f2526ad1be Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 19 Nov 2021 10:08:40 +0800 Subject: [PATCH 3/7] * Fix bug #16467. --- module/product/js/browse.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/module/product/js/browse.js b/module/product/js/browse.js index 57b1a6833c..1ad8cfaff6 100644 --- a/module/product/js/browse.js +++ b/module/product/js/browse.js @@ -112,12 +112,6 @@ $(function() }); if($("main").is(".hide-sidebar")) $("#sidebarHeader").hide(); - var isClickStoryToggle = false; - $(".story-toggle").click(function() - { - isClickStoryToggle = true; - }); - /* Shift key selection. */ var isClickStoryToggle = false; var lastStorySelected = ''; From 4ffbc120a07c6e8fdee9ddbf2f5f68a8a6c16f2b Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 19 Nov 2021 10:14:47 +0800 Subject: [PATCH 4/7] * Fix bug #16467. --- module/product/js/browse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/product/js/browse.js b/module/product/js/browse.js index 1ad8cfaff6..cbbc03ed83 100644 --- a/module/product/js/browse.js +++ b/module/product/js/browse.js @@ -114,7 +114,7 @@ $(function() /* Shift key selection. */ var isClickStoryToggle = false; - var lastStorySelected = ''; + var lastStorySelected = ''; $(".story-toggle").click(function() { isClickStoryToggle = true; From 7ed253e111916e37e1d7676d8e0cd7190c190466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Fri, 19 Nov 2021 11:08:04 +0800 Subject: [PATCH 5/7] * Finish task #44349. --- module/story/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/model.php b/module/story/model.php index 11c96dd2dd..7a1924c343 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3355,7 +3355,7 @@ class storyModel extends model { $action = strtolower($action); - if($story->parent < 0 and $action != 'edit' and $action != 'batchcreate') return false; + if($story->parent < 0 and $action != 'edit' and $action != 'batchcreate' and $action != 'change') return false; global $app; From 8cde6c30d4cc6acd39ee97a0b8bf12f14a104e7c Mon Sep 17 00:00:00 2001 From: liyuchun Date: Fri, 19 Nov 2021 12:26:23 +0800 Subject: [PATCH 6/7] * Finish task #44357,#44358. --- module/common/view/kanban.html.php | 3 +- module/execution/js/executionkanban.js | 44 ++++++++++++++++-- .../execution/view/executionkanban.html.php | 8 ++++ module/project/js/kanban.js | 46 +++++++++++++++---- module/project/view/kanban.html.php | 7 +++ 5 files changed, 94 insertions(+), 14 deletions(-) diff --git a/module/common/view/kanban.html.php b/module/common/view/kanban.html.php index 07a4759efd..3e96f73506 100644 --- a/module/common/view/kanban.html.php +++ b/module/common/view/kanban.html.php @@ -59,8 +59,7 @@ #kanbanList .kanban-affixed .kanban-header-col[data-type="doingProject"]:after {background-color: #606060;} /* Show project and execution in one row */ -#kanbanList .kanban-lane-col[data-type="doingProject"] {box-shadow: 2px 0 0 #fff;} -#kanbanList .kanban-lane-col[data-type="doingProject"] + .kanban-lane-col {border-left: none;} +#kanbanList .kanban-lane-col[data-type="doingProject"] + .kanban-lane-col {border-left: none; box-shadow: inset 2px 0 0 #fff;} #kanbanList .kanban-lane-col[data-type="doingProject"] > .kanban-lane-items {padding: 0; overflow: visible; max-height: none!important;} #kanbanList .project-row {position: relative; width: 200%; width: calc(200% + 2px);} #kanbanList .project-row + .project-row {border-top: 2px solid #fff;} diff --git a/module/execution/js/executionkanban.js b/module/execution/js/executionkanban.js index 3dc8822f84..33f6bfeb60 100644 --- a/module/execution/js/executionkanban.js +++ b/module/execution/js/executionkanban.js @@ -50,7 +50,6 @@ function findDropColumns($element, $root) var col = $col.data(); var lane = $col.closest('.kanban-lane').data(); var kanbanID = $root.data('id'); - console.log('findDropColumns', {$element, $root, kanbanID, col, lane}); var kanbanRules = window.kanbanDropRules ? window.kanbanDropRules[kanbanID] : null; if(!kanbanRules) return $root.find('.kanban-lane[data-id="' + lane.id + '"] .kanban-lane-col:not([data-type="project"],[data-type="' + col.type + '"])'); @@ -74,7 +73,7 @@ function findDropColumns($element, $root) /** * Change column type for a card - * 变更卡片类型 + * @param {Object} card Card object * @param {String} fromColType The column type before change * @param {String} toColType The column type after change @@ -82,8 +81,45 @@ function findDropColumns($element, $root) */ function changeCardColType(card, fromColType, toColType, kanbanID) { - /* TODO: Post data to server on change card type 将变更卡片类型操作提交到服务器 */ - console.log('TODO: Post data to server on change card type 将变更卡片类型操作提交到服务器', {card, fromColType, toColType, kanbanID}); + var cardID = card.id; + var executionID = cardID.substr(cardID.indexOf("-") + 1);; + var showIframe = false; + + if(toColType == 'doing') + { + if(fromColType == 'wait' && priv.canStart) + { + var link = createLink('execution', 'start', 'executionID=' + executionID, '', true); + showIframe = true; + } + if((fromColType == 'suspended' || fromColType == 'closed') && priv.canActivate) + { + var link = createLink('execution', 'activate', 'executionID=' + executionID, '', true); + showIframe = true; + } + } + else if(toColType == 'suspended') + { + if((fromColType == 'wait' || fromColType == 'doing') && priv.canSuspend) + { + var link = createLink('execution', 'suspend', 'executionID=' + executionID, '', true); + showIframe = true; + } + } + else if(toColType == 'closed') + { + if(priv.canClose) + { + var link = createLink('execution', 'close', 'executionID=' + executionID, '', true); + showIframe = true; + } + } + + if(showIframe) + { + var modalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '80%', url: link}); + modalTrigger.show(); + } /* // TODO: The server must return a updated kanban data 服务器返回更新后的看板数据 diff --git a/module/execution/view/executionkanban.html.php b/module/execution/view/executionkanban.html.php index ed3a0d8d49..121ab6fb94 100644 --- a/module/execution/view/executionkanban.html.php +++ b/module/execution/view/executionkanban.html.php @@ -32,6 +32,14 @@ js::set('statusColorList', $lang->execution->statusColorList); js::set('langMyExecutions', $lang->execution->myExecutions); js::set('langDoingProject', $lang->execution->doingProject); js::set('projectNames', $projects); +js::set('priv', + array( + 'canStart' => common::hasPriv('execution', 'start'), + 'canSuspend' => common::hasPriv('execution', 'suspend'), + 'canClose' => common::hasPriv('execution', 'close'), + 'canActivate' => common::hasPriv('execution', 'activate'), + ) +); ?> diff --git a/module/project/js/kanban.js b/module/project/js/kanban.js index cc61a2a358..94447b1986 100644 --- a/module/project/js/kanban.js +++ b/module/project/js/kanban.js @@ -92,7 +92,6 @@ function findDropColumns($element, $root) /** * Change column type for a card - * 变更卡片类型 * @param {Object} card Card object * @param {String} fromColType The column type before change * @param {String} toColType The column type after change @@ -100,8 +99,37 @@ function findDropColumns($element, $root) */ function changeCardColType(card, fromColType, toColType, kanbanID) { - /* TODO: Post data to server on change card type 将变更卡片类型操作提交到服务器 */ - console.log('TODO: Post data to server on change card type 将变更卡片类型操作提交到服务器', {card, fromColType, toColType, kanbanID}); + var cardID = card.id; + var projectID = cardID.substr(cardID.indexOf("-") + 1);; + var showIframe = false; + + if(toColType == 'doingProject') + { + if(fromColType == 'waitProject' && priv.canStart) + { + var link = createLink('project', 'start', 'project=' + projectID, '', true); + showIframe = true; + } + if(fromColType == 'closedProject' && priv.canActivate) + { + var link = createLink('project', 'activate', 'projectID=' + projectID, '', true); + showIframe = true; + } + } + else if(toColType == 'closedProject') + { + if(priv.canClose) + { + var link = createLink('project', 'close', 'projectID=' + projectID, '', true); + showIframe = true; + } + } + + if(showIframe) + { + var modalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '80%', url: link}); + modalTrigger.show(); + } /* // TODO: The server must return a updated kanban data 服务器返回更新后的看板数据 @@ -118,15 +146,17 @@ function changeCardColType(card, fromColType, toColType, kanbanID) */ function handleFinishDrop(event) { - var $card = $(event.element); // The drag card + var $card = $(event.element); // The drag card var $dragCol = $card.closest('.kanban-lane-col'); var $dropCol = $(event.target); - /* Get d-n-d(drag and drop) infos 获取拖放操作相关信息 */ - var card = $card.data('item'); + /* Get d-n-d(drag and drop) infos. */ + var card = $card.data('item'); var fromColType = $dragCol.data('type'); - var toColType = $dropCol.data('type'); - var kanbanID = $card.closest('.kanban').data('id'); + var toColType = $dropCol.data('type'); + var kanbanID = $card.closest('.kanban').data('id'); + + if(fromColType == 'doingProject') card = $card.parent().parent().data('item'); changeCardColType(card, fromColType, toColType, kanbanID); } diff --git a/module/project/view/kanban.html.php b/module/project/view/kanban.html.php index fec377c4ff..a96ed7ee8d 100644 --- a/module/project/view/kanban.html.php +++ b/module/project/view/kanban.html.php @@ -44,6 +44,13 @@ js::set('kanbanGroup', $kanbanGroup); js::set('latestExecutions', $latestExecutions); js::set('programPairs', $programPairs); js::set('doingText', $lang->project->statusList['doing']); +js::set('priv', + array( + 'canStart' => common::hasPriv('project', 'start'), + 'canClose' => common::hasPriv('project', 'close'), + 'canActivate' => common::hasPriv('project', 'activate'), + ) +); ?> From 35915aa0dee9e005949f9fff738f0a3031beaab6 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Fri, 19 Nov 2021 14:16:19 +0800 Subject: [PATCH 7/7] * Update the datatable min.js and min.css file. --- www/js/datatable/min.css | 6 +++--- www/js/datatable/min.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/www/js/datatable/min.css b/www/js/datatable/min.css index d9998a4199..6c97c7ca4c 100644 --- a/www/js/datatable/min.css +++ b/www/js/datatable/min.css @@ -1,6 +1,6 @@ /*! - * ZUI: 数据表格 - v1.8.1 - 2018-05-09 - * http://zui.sexy + * ZUI: 数据表格 - v1.10.0 - 2021-11-04 + * http://openzui.com * GitHub: https://github.com/easysoft/zui.git - * Copyright (c) 2018 cnezsoft.com; Licensed MIT + * Copyright (c) 2021 cnezsoft.com; Licensed MIT */.datatable-head,.datatable-rows{display:table;width:100%;table-layout:fixed}.datatable{margin-bottom:20px}.datatable>.datatable-head{-webkit-transition:-webkit-box-shadow .2s;-o-transition:box-shadow .2s;transition:-webkit-box-shadow .2s;transition:box-shadow .2s;transition:box-shadow .2s,-webkit-box-shadow .2s}.datatable .table{margin:0;table-layout:fixed}.datatable .table>tbody>tr>td,.datatable .table>thead>tr>th{min-width:20px}.datatable .table>tbody>tr>td.check-btn,.datatable .table>thead>tr>th.check-btn{width:30px;color:#9b9b9b;text-align:center;cursor:pointer}.datatable .table>tbody>tr.active>td.check-btn,.datatable .table>tbody>tr.hover>td.check-btn,.datatable .table>tbody>tr>td.check-btn.checked,.datatable .table>tbody>tr>td.check-btn:hover,.datatable .table>thead>tr>th.check-btn.checked,.datatable .table>thead>tr>th.check-btn:hover{color:#4f4f4f}.datatable .table>tbody>tr.active>td.check-btn>.icon-check-empty:before,.datatable .table>tbody>tr>td.check-btn.checked>.icon-check-empty:before,.datatable .table>thead>tr>th.check-btn.checked>.icon-check-empty:before{content:'\e642'}.datatable .table>thead>tr>th.col-hover{background-color:#e2e2e2}.datatable .table>tbody>tr.hover>td,.datatable .table>tbody>tr>td.col-hover{background-color:#ebf2f9}.datatable .table>tbody>tr.active.hover td{background-color:#ffdea2}.datatable.head-fixed>.datatable-head{position:fixed;z-index:1030;-webkit-box-shadow:0 1px 4px 0 rgba(0,0,0,.15);box-shadow:0 1px 4px 0 rgba(0,0,0,.15)}.datatable.sortable .datatable-head-span .table>thead>tr>th{overflow:hidden;white-space:nowrap;cursor:pointer}.datatable.sortable .datatable-head-span .table>thead>tr>th.text-center{padding-right:0;padding-left:0}.datatable.sortable .datatable-head-span .table>thead>tr>th:after{display:inline-block;margin-left:5px;font-family:ZenIcon;font-size:14px;font-style:normal;font-weight:400;font-variant:normal;line-height:1;color:grey;text-transform:none;content:'\e6bd';speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.datatable.sortable .datatable-head-span .table>thead>tr>th.sort-down:after{color:#145ccd;content:'\e6b8'}.datatable.sortable .datatable-head-span .table>thead>tr>th.sort-up:after{color:#145ccd;content:'\e6b9'}.datatable.sortable .datatable-head-span .table>thead>tr>th.check-btn:after,.datatable.sortable .datatable-head-span .table>thead>tr>th.sort-disabled:after{display:none}.datatable.sortable .datatable-head-span .table>thead>tr>th.sort-disabled{cursor:default}.datatable-wrapper{position:relative}.datatable-span{display:table-cell;vertical-align:top}.datatable-span.flexarea{overflow:hidden}.datatable-span.flexarea.datatable-head-span.dragging{cursor:move!important}.datatable-span.flexarea .table{position:relative;top:0;left:0}.datatable-span.flexarea .scrolled-shadow{position:absolute;top:0;bottom:0;display:none;width:20px;-webkit-box-shadow:0 0 10px rgba(0,0,0,.15);box-shadow:0 0 10px rgba(0,0,0,.15);opacity:0;-webkit-transition:all .4s cubic-bezier(.175,.885,.32,1);-o-transition:all .4s cubic-bezier(.175,.885,.32,1);transition:all .4s cubic-bezier(.175,.885,.32,1)}.datatable-span.flexarea .scrolled-in-shadow{left:-30px}.datatable-span.flexarea .scrolled-out-shadow{right:-30px}.datatable>.scroll-wrapper{position:relative;width:100%}.datatable .scroll-slide{position:absolute;right:-1px;bottom:0;left:-1px;display:none;height:11px;background:#e5e5e5;background:rgba(128,128,128,.1);border:1px solid #e5e5e5;border-bottom:none;opacity:0;-webkit-transition:opacity .5s,background .3s;-o-transition:opacity .5s,background .3s;transition:opacity .5s,background .3s}.datatable .scroll-slide>.bar{position:absolute;top:0;left:0;min-width:50px;height:10px;cursor:move;background-color:#a6a6a6}.datatable .scroll-slide:hover>.bar{background-color:grey}.datatable .scroll-slide.scroll-pos-out{bottom:-14px;height:15px}.datatable .scroll-slide.scroll-pos-out>.bar{height:14px}.datatable.show-scroll-slide.scrolling .scroll-slide,.datatable.show-scroll-slide.scrolling .scrolled-shadow,.datatable.show-scroll-slide:hover .scroll-slide,.datatable.show-scroll-slide:hover .scrolled-shadow{opacity:1}.datatable.show-scroll-slide .scroll-slide,.datatable.show-scroll-slide .scrolled-shadow{display:block}.datatable.show-scroll-slide.scrolled-in .scrolled-in-shadow{left:-20px}.datatable.show-scroll-slide.scrolled-out .scrolled-out-shadow{right:-20px} \ No newline at end of file diff --git a/www/js/datatable/min.js b/www/js/datatable/min.js index daf3b41a70..5c7b2b77b3 100644 --- a/www/js/datatable/min.js +++ b/www/js/datatable/min.js @@ -1,7 +1,7 @@ /*! - * ZUI: 数据表格 - v1.8.1 - 2018-11-14 - * http://zui.sexy + * ZUI: 数据表格 - v1.10.0 - 2021-11-04 + * http://openzui.com * GitHub: https://github.com/easysoft/zui.git - * Copyright (c) 2018 cnezsoft.com; Licensed MIT + * Copyright (c) 2021 cnezsoft.com; Licensed MIT */ -!function(a){"use strict";var t="zui.datatable",e=a.zui.store,s=function(e,s){this.name=t,this.$=a(e),this.isTable="TABLE"===this.$[0].tagName,this.firstShow=!0,this.isTable?(this.$table=this.$,this.id="datatable-"+(this.$.attr("id")||a.zui.uuid())):(this.$datatable=this.$.addClass("datatable"),this.$.attr("id")?this.id=this.$.attr("id"):(this.id="datatable-"+a.zui.uuid(),this.$.attr("id",this.id))),this.getOptions(s),this.load(),this.callEvent("ready")};s.DEFAULTS={checkable:!1,checkByClickRow:!0,checkedClass:"active",checkboxName:null,selectable:!0,sortable:!1,storage:!0,fixedHeader:!1,fixedHeaderOffset:0,fixedLeftWidth:"30%",fixedRightWidth:"30%",flexHeadDrag:!0,scrollPos:"in",rowHover:!0,colHover:!0,hoverClass:"hover",colHoverClass:"col-hover",fixCellHeight:!0,mergeRows:!1,minColWidth:20,minFixedLeftWidth:200,minFixedRightWidth:200,minFlexAreaWidth:200},s.prototype.getOptions=function(t){var e=this.$;t=a.extend({},s.DEFAULTS,this.$.data(),t),t.tableClass=t.tableClass||"",t.tableClass=" "+t.tableClass+" table-datatable",a.each(["bordered","condensed","striped","condensed","fixed"],function(a,s){s="table-"+s,e.hasClass(s)&&(t.tableClass+=" "+s)}),(e.hasClass("table-hover")||t.rowHover)&&(t.tableClass+=" table-hover"),t.checkable&&a.fn.selectable||(t.selectable=!1),this.options=t},s.prototype.load=function(e){var s,l=this.options;if(a.isFunction(e))e=e(this.data,this),e.keepSort=!0;else if(a.isPlainObject(e))this.data=e;else if("string"==typeof e){var d=a(e);d.length&&(this.$table=d.first(),this.$table.data(t,this),this.isTable=!0),e=null}else e=l.data;if(!e){if(!this.isTable)throw new Error("No data avaliable!");e={cols:[],rows:[]},s=e.cols;var i,r,o,n,c,h,f=e.rows,p=this.$table;p.children("thead").children("tr:first").children("th").each(function(){r=a(this),s.push(a.extend({text:r.html(),flex:r.hasClass("flex-col"),width:"auto",cssClass:r.attr("class"),css:r.attr("style"),type:"string",ignore:r.hasClass("ignore"),sort:!r.hasClass("sort-disabled"),mergeRows:r.attr("merge-rows"),title:r.attr("title")},r.data()))}),p.children("tbody").children("tr").each(function(){o=a(this),c=a.extend({data:[],checked:!1,cssClass:o.attr("class"),css:o.attr("style"),id:o.attr("id")},o.data()),o.children("td").each(function(){if(n=a(this),h=n.attr("colspan")||1,c.data.push(a.extend({cssClass:n.attr("class"),css:n.attr("style"),text:n.html(),colSpan:h,title:n.attr("title")},n.data())),h>1)for(i=1;i').append(b))}e.flexStart=-1,e.flexEnd=-1,s=e.cols,e.colsLength=s.length;for(var i=0;i=0,e.fixedRight=e.flexEnd>=0&&e.flexEnd0,e.flexStart<0&&e.flexEnd<0&&(e.fixedLeft=!0,e.flexStart=e.colsLength,e.flexEnd=e.colsLength),this.data=e,this.callEvent("afterLoad",{data:e}),this.render()},s.prototype.render=function(){var e,s,l,d,i=this,r=i.$datatable||(i.isTable?a('
'):i.$datatable),o=i.options,n=i.data,c=i.data.cols,h=i.data.rows,f=o.checkable,p='
',b='
';r.children(".datatable-head, .datatable-rows, .scroll-wrapper").remove(),r.toggleClass("sortable",o.sortable);var g,v,w,x=a('
');for(e=a(''),l=a(''),d=a(''),s=0;s=n.flexStart&&s<=n.flexEnd?d:l,0===s&&f&&g.append(''),w.ignore||(v=a(''),v.toggleClass("sort-down","down"===w.sort).toggleClass("sort-up","up"===w.sort).toggleClass("sort-disabled",w.sort===!1),v.addClass(w.cssClass).addClass(w.colClass).html(w.text).attr({"data-index":s,"data-type":w.type,style:w.css,title:w.title}).css("width",w.width),g.append(v));var u;n.fixedLeft&&(u=a(b),u.addClass("fixed-left").find("table").addClass(o.tableClass).find("thead").append(e),x.append(u)),n.flexArea&&(u=a(b),u.addClass("flexarea").find(".datatable-wrapper").append('
').find("table").addClass(o.tableClass).find("thead").append(d),x.append(u)),n.fixedRight&&(u=a(b),u.addClass("fixed-right").find("table").addClass(o.tableClass).find("thead").append(l),x.append(u)),r.append(x);var C,k,m,y,$,S,E,L,H=a('
'),A=h.length;e=a(""),l=a(""),d=a("");for(var R=0;R'),C.addClass(S.cssClass).toggleClass(o.checkedClass,!!S.checked).attr({"data-index":R,"data-id":S.id}),k=C.clone().addClass("datatable-row-flex"),m=C.clone().addClass("datatable-row-right"),C.addClass("datatable-row-left"),L=S.data.length,s=0;s0&&E.empty||(g=s=n.flexStart&&s<=n.flexEnd?k:m,0===s&&f&&($=a(''),o.checkboxName&&$.append(''),g.append($)),c[s].ignore||(a.isPlainObject(E)?(E.row=R,E.index=s):E={text:E,row:R,index:s},S.data[s]=E,y=a(''),y.html(E.text).addClass(E.cssClass).addClass(c[s].colClass).attr("colspan",E.colSpan).attr({"data-row":R,"data-index":s,"data-flex":!1,"data-type":c[s].type,style:E.css,title:E.title||""}).css("width",c[s].width),g.append(y)));e.append(C),d.append(k),l.append(m)}var T;n.fixedLeft&&(T=a(p),T.addClass("fixed-left").find("table").addClass(o.tableClass).append(e),H.append(T)),n.flexArea&&(T=a(p),T.addClass("flexarea").find(".datatable-wrapper").append('
').find("table").addClass(o.tableClass).append(d),H.append(T)),n.fixedRight&&(T=a(p),T.addClass("fixed-right").find("table").addClass(o.tableClass).append(l),H.append(T)),r.append(H),n.flexArea&&r.append('
');var z=r.children(".datatable-footer").detach();n.footer?(r.append(a('