Commit 1927989d by aa.gusti

Perbaikan Checklist All DETABLE

1 parent c0d3b361
...@@ -197,6 +197,13 @@ class DeTable(field.Field): ...@@ -197,6 +197,13 @@ class DeTable(field.Field):
""" """
header_buttons.insert(0, button) header_buttons.insert(0, button)
if allow_check:
button = f"""
<input type="checkbox" class="${tableid}checkAll">All</input>
"""
header_buttons.insert(0, button)
self.buttons = "','".join(header_buttons).replace('\n', ""). \ self.buttons = "','".join(header_buttons).replace('\n', ""). \
replace(';', ';\n') replace(';', ';\n')
self.tableid = tableid self.tableid = tableid
......
<div <div tal:define="style style|field.widget.style;
tal:define="style style|field.widget.style;
css_class css_class|string:${field.widget.css_class or field.css_class or 'jarviswidget jarviswidget-color-blueLight'}; css_class css_class|string:${field.widget.css_class or field.css_class or 'jarviswidget jarviswidget-color-blueLight'};
item_template item_template|field.widget.item_template; item_template item_template|field.widget.item_template;
title title|field.title; title title|field.title;
...@@ -27,10 +26,7 @@ ...@@ -27,10 +26,7 @@
filter_columns filter_columns|field.filter_columns; filter_columns filter_columns|field.filter_columns;
filter_scripts filter_scripts|field.filter_scripts; filter_scripts filter_scripts|field.filter_scripts;
filter_form filter_form|field.filter_form; filter_form filter_form|field.filter_form;
" " tal:attributes="style style; class css_class; attributes|field.widget.attributes|{};" i18n:domain="detable">
tal:attributes="style style; class css_class; attributes|field.widget.attributes|{};"
i18n:domain="detable"
>
<header role="heading" class="txt-color-grayDark"> <header role="heading" class="txt-color-grayDark">
<h2 tal:condition="title"><i class="fa fa-fw fa-table"></i>${title}</h2> <h2 tal:condition="title"><i class="fa fa-fw fa-table"></i>${title}</h2>
<div class="alert alert-danger " role="alert" id="emptyID" style="opacity:0.7;display: none;"> <div class="alert alert-danger " role="alert" id="emptyID" style="opacity:0.7;display: none;">
...@@ -41,7 +37,7 @@ ...@@ -41,7 +37,7 @@
</div> </div>
<div role="content"> <div role="content">
<div class="widget-body"> <div class="widget-body">
<div class="row" tal:condition="filter_columns" > <div class="row" tal:condition="filter_columns">
<div id="${tableid}-form-filter-container" class="col-md-3"> <div id="${tableid}-form-filter-container" class="col-md-3">
<div id="${tableid}-form-filter" class="collapse"> <div id="${tableid}-form-filter" class="collapse">
${structure:filter_form} ${structure:filter_form}
...@@ -49,14 +45,14 @@ ...@@ -49,14 +45,14 @@
</div> </div>
</div> </div>
<div tal:condition="allow_check=='true'"> <div tal:condition="allow_check=='true'">
<div class="row"> <!-- <div class="row">
<div class="input-group col-md-2"> <div class="input-group col-md-2">
<span class="input-group-addon"> <span class="input-group-addon">
<input type="checkbox" class="${tableid}checkAll"/> <input type="checkbox" class="${tableid}checkAll"/>
</span> </span>
<label for="${tableid}checkAll">Pilih Semua</label> <label for="${tableid}checkAll">Pilih Semua</label>
</div> </div>
</div> </div> -->
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$('.${tableid}checkAll').click(function () { $('.${tableid}checkAll').click(function () {
...@@ -69,12 +65,13 @@ ...@@ -69,12 +65,13 @@
}); });
</script> </script>
</div> </div>
<table id="${tableid}" <table id="${tableid}" class="table table-bordered table-hover table-condensed dataTable no-footer">
class="table table-bordered table-hover table-condensed dataTable no-footer">
<thead> <thead>
<tr> <tr>
<tal:block tal:repeat="child field"> <tal:block tal:repeat="child field">
<th tal:condition="python:hasattr(child, 'action') and not getattr(child.condition)==False and False or True">${child.title}</th> <th
tal:condition="python:hasattr(child, 'action') and not getattr(child.condition)==False and False or True">
${child.title}</th>
</tal:block> </tal:block>
</tr> </tr>
...@@ -101,14 +98,14 @@ ...@@ -101,14 +98,14 @@
var o${tableid}Url = o${tableid}Uri + "${url_suffix}"; var o${tableid}Url = o${tableid}Uri + "${url_suffix}";
var m${tableid}ID; var m${tableid}ID;
var m${tableid}CheckList = []; var m${tableid}CheckList = [];
var check_field =${check_field}; var check_field = ${check_field};
deform.addCallback('${tableid}', function (oid) { deform.addCallback('${tableid}', function (oid) {
// $(document).ready(function () { // $(document).ready(function () {
function displayEmptyID() { function displayEmptyID() {
$("#emptyID").show(); $("#emptyID").show();
$('#emptyID').animate({opacity: 0.8}, 2000); $('#emptyID').animate({ opacity: 0.8 }, 2000);
setTimeout(function () { setTimeout(function () {
$("#emptyID").fadeTo(500, 0).slideUp(500, function () { $("#emptyID").fadeTo(500, 0).slideUp(500, function () {
$("#emptyID").hide(); $("#emptyID").hide();
...@@ -152,7 +149,7 @@ ...@@ -152,7 +149,7 @@
function render_checklist(value) { function render_checklist(value) {
return '<input type="checkbox" class="${tableid}_check" checked="' + {value} + '"></input>'; return '<input type="checkbox" class="${tableid}_check" checked="' + { value } + '"></input>';
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!