Commit 1927989d by aa.gusti

Perbaikan Checklist All DETABLE

1 parent c0d3b361
......@@ -197,6 +197,13 @@ class DeTable(field.Field):
"""
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', ""). \
replace(';', ';\n')
self.tableid = tableid
......
<div
tal:define="style style|field.widget.style;
<div 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'};
item_template item_template|field.widget.item_template;
title title|field.title;
......@@ -27,10 +26,7 @@
filter_columns filter_columns|field.filter_columns;
filter_scripts filter_scripts|field.filter_scripts;
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">
<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;">
......@@ -41,7 +37,7 @@
</div>
<div role="content">
<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" class="collapse">
${structure:filter_form}
......@@ -49,14 +45,14 @@
</div>
</div>
<div tal:condition="allow_check=='true'">
<div class="row">
<!-- <div class="row">
<div class="input-group col-md-2">
<span class="input-group-addon">
<input type="checkbox" class="${tableid}checkAll"/>
</span>
<label for="${tableid}checkAll">Pilih Semua</label>
</div>
</div>
</div> -->
<script>
$(document).ready(function () {
$('.${tableid}checkAll').click(function () {
......@@ -69,12 +65,13 @@
});
</script>
</div>
<table id="${tableid}"
class="table table-bordered table-hover table-condensed dataTable no-footer">
<table id="${tableid}" class="table table-bordered table-hover table-condensed dataTable no-footer">
<thead>
<tr>
<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>
</tr>
......@@ -101,14 +98,14 @@
var o${tableid}Url = o${tableid}Uri + "${url_suffix}";
var m${tableid}ID;
var m${tableid}CheckList = [];
var check_field =${check_field};
var check_field = ${check_field};
deform.addCallback('${tableid}', function (oid) {
// $(document).ready(function () {
function displayEmptyID() {
$("#emptyID").show();
$('#emptyID').animate({opacity: 0.8}, 2000);
$('#emptyID').animate({ opacity: 0.8 }, 2000);
setTimeout(function () {
$("#emptyID").fadeTo(500, 0).slideUp(500, function () {
$("#emptyID").hide();
......@@ -152,7 +149,7 @@
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!