Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
irul
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7472c8b0
authored
Dec 13, 2024
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
detable checklist
1 parent
d6ab3bfc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
32 deletions
opensipkd/detable/templates/detable.pt
opensipkd/detable/templates/detable.pt
View file @
7472c8b
...
@@ -47,23 +47,28 @@
...
@@ -47,23 +47,28 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div tal:condition="allow_check">
<div class="row" tal:condition="allow_check=='true'">
<input type="checkbox" class="${tableid}checkAll">Pilih Semua
<div class="form-group col-md-3">
<script>
<div class="input-group">
$(document).ready(function () {
<input type="checkbox" class="${tableid}checkAll"/>
$('.${tableid}checkAll').click(function () {
<span
if (this.checked) {
class="input-group-addon">Pilih Semua
console.log("AAAAAAAAAAAA");
</span>
$(".${tableid}_check").prop("checked", true);
</div>
} else {
<script>
console.log("BBBBBBBBBBBB");
$(document).ready(function () {
$(".${tableid}_check").prop("checked", false);
$('.${tableid}checkAll').click(function () {
}
if (this.checked) {
console.log("AAAAAAAAAAAA");
$(".${tableid}_check").prop("checked", true);
} else {
console.log("BBBBBBBBBBBB");
$(".${tableid}_check").prop("checked", false);
}
});
});
});
</script>
</div>
});
</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">
...
@@ -94,7 +99,7 @@
...
@@ -94,7 +99,7 @@
var o${tableid}Uri = "${url}";
var o${tableid}Uri = "${url}";
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}ChekList = [];
var m${tableid}Che
c
kList = [];
deform.addCallback('${tableid}', function (oid) {
deform.addCallback('${tableid}', function (oid) {
// $(document).ready(function () {
// $(document).ready(function () {
...
@@ -145,7 +150,7 @@
...
@@ -145,7 +150,7 @@
function render_checklist(value) {
function render_checklist(value) {
return '<input type="checkbox" checked="' + {value} + '"></input>';
return '<input type="checkbox" c
lass="${tableid}_check" c
hecked="' + {value} + '"></input>';
}
}
...
@@ -183,7 +188,7 @@
...
@@ -183,7 +188,7 @@
${tableid}Columns[co].render = function (id) {
${tableid}Columns[co].render = function (id) {
let result = "";
let result = "";
if (${allow_check}) {
if (${allow_check}) {
result = '<input type="checkbox" class="${tableid}_check" value="' + id + '"
id="${tableid}check' + id + '"
> ';
result = '<input type="checkbox" class="${tableid}_check" value="' + id + '"
/
> ';
}
}
if (${allow_view})
if (${allow_view})
result += '<a href="${url}/' + id + '/view"><i class="fas fa-eye" aria-hidden="true" title="View"></i></a> ';
result += '<a href="${url}/' + id + '/view"><i class="fas fa-eye" aria-hidden="true" title="View"></i></a> ';
...
@@ -251,19 +256,11 @@
...
@@ -251,19 +256,11 @@
$("div.toolbar").attr('style', 'display:block; float: left; margin-bottom:6px; line-height:16px;');
$("div.toolbar").attr('style', 'display:block; float: left; margin-bottom:6px; line-height:16px;');
$('#${tableid} tbody tr td').on('click', ':checkbox', function (event) {
$('#${tableid} tbody').on('click', ':checkbox', function () {
alert("checkbox clicked");
if (this.checked) m${tableid}CheckList.push($(this).val());
if (this.checked) {
else m${tableid}CheckList.splice(m${tableid}CheckList.indexOf($(this).val()), 1);
m${tableid}ChekList.push($(this).val());
});
} else {
m${tableid}CheckList.splice(m${tableid}CheckList.indexOf($(this).val()), 1);
}
console.log(m${tableid}CheckList);
})
$('#${tableid} tbody').on('click', 'tr', function () {
$('#${tableid} tbody').on('click', 'tr', function () {
// alert("table clicked");
if ($(this).hasClass('selected')) {
if ($(this).hasClass('selected')) {
$(this).removeClass('selected');
$(this).removeClass('selected');
m${tableid}ID = null;
m${tableid}ID = null;
...
@@ -272,7 +269,6 @@
...
@@ -272,7 +269,6 @@
o${tableid}.$('tr.selected').removeClass('selected');
o${tableid}.$('tr.selected').removeClass('selected');
$(this).addClass('selected');
$(this).addClass('selected');
m${tableid}ID = aData.id;
m${tableid}ID = aData.id;
//console.log("m${tableid}ID", m${tableid}ID);
o${tableid}.$('tr.row_selected').removeClass('row_selected');
o${tableid}.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
$(this).addClass('row_selected');
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment