Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6f0008b5
authored
Aug 02, 2022
by
aagusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan prosedure
1 parent
314994c5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
186 additions
and
145 deletions
external/tiny_sxw2rml.py
opensipkd/base/static/css/osipkd.css
opensipkd/base/static/v3/ttr.csv
opensipkd/base/static/v3/user.csv
opensipkd/base/views/base_views.py
opensipkd/detable/detable.py
opensipkd/detable/templates/detable.pt
external/tiny_sxw2rml.py
View file @
6f0008b
...
@@ -52,7 +52,7 @@ import string
...
@@ -52,7 +52,7 @@ import string
import
os
import
os
import
zipfile
import
zipfile
import
xml.dom.minidom
import
xml.dom.minidom
from
reportlab.lib.divisis
import
toLength
#
from reportlab.lib.divisis import toLength
import
base64
import
base64
class
DomApiGeneral
:
class
DomApiGeneral
:
...
@@ -150,7 +150,7 @@ class DomApi(DomApiGeneral):
...
@@ -150,7 +150,7 @@ class DomApi(DomApiGeneral):
# ******** always use the following order:
# ******** always use the following order:
self
.
buildStyleDict
()
self
.
buildStyleDict
()
self
.
buildStylePropertiesDict
()
self
.
buildStylePropertiesDict
()
if
self
.
styles_dom
.
getElementsByTagName
(
"style:page-master"
)
.
__len__
()
<>
0
:
if
self
.
styles_dom
.
getElementsByTagName
(
"style:page-master"
)
.
__len__
()
!=
0
:
self
.
page_master
=
self
.
styles_dom
.
getElementsByTagName
(
"style:page-master"
)[
0
]
self
.
page_master
=
self
.
styles_dom
.
getElementsByTagName
(
"style:page-master"
)[
0
]
self
.
document
=
self
.
content_dom
.
getElementsByTagName
(
"office:document-content"
)[
0
]
self
.
document
=
self
.
content_dom
.
getElementsByTagName
(
"office:document-content"
)[
0
]
...
@@ -354,12 +354,13 @@ if __name__ == "__main__":
...
@@ -354,12 +354,13 @@ if __name__ == "__main__":
parser
.
error
(
"incorrect number of arguments"
)
parser
.
error
(
"incorrect number of arguments"
)
import
sys
import
sys
import
StringIO
import
io
#StringIO
fname
=
sys
.
argv
[
1
]
fname
=
sys
.
argv
[
1
]
f
=
StringIO
.
StringIO
(
file
(
fname
)
.
read
())
f
=
io
.
StringIO
(
open
(
fname
)
.
read
())
xsl
=
file
(
os
.
path
.
join
(
os
.
getcwd
(),
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
'normalized_oo2rml.xsl'
))
.
read
()
xsl
=
open
(
os
.
path
.
join
(
os
.
getcwd
(),
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
'normalized_oo2rml.xsl'
))
.
read
()
result
=
sxw2rml
(
f
,
xsl
,
output
=
opt
.
output
,
save_pict
=
False
)
result
=
sxw2rml
(
f
,
xsl
,
output
=
opt
.
output
,
save_pict
=
False
)
print
result
print
(
result
)
opensipkd/base/static/css/osipkd.css
View file @
6f0008b
...
@@ -183,4 +183,12 @@ div.tab-content {
...
@@ -183,4 +183,12 @@ div.tab-content {
-moz-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
user-select
:
none
;
}
.dataTables_paginate
{
font-size
:
10px
!important
;
}
.paginate_button
.current
{
font-size
:
10px
!important
;
}
}
\ No newline at end of file
\ No newline at end of file
opensipkd/base/static/v3/ttr.csv
0 → 100644
View file @
6f0008b
id,thn_pajak_sppt,nik,nm_wp,nik_doc,tgl_terima_wp
2,32.79-010.006-009.0218-0,2022,1234567890123456,BBB,XGBytf.jpeg,2022-07-26 00:00:00
opensipkd/base/static/v3/user.csv
0 → 100644
View file @
6f0008b
id,thn_pajak_sppt,nik,nm_wp,nik_doc,tgl_terima_wp
2,32.79-010.006-009.0218-0,2022,1234567890123456,BBB,XGBytf.jpeg,2022-07-26 00:00:00
opensipkd/base/views/base_views.py
View file @
6f0008b
...
@@ -12,7 +12,7 @@ from pyramid.httpexceptions import HTTPFound
...
@@ -12,7 +12,7 @@ from pyramid.httpexceptions import HTTPFound
from
.common
import
DataTables
from
.common
import
DataTables
from
..
import
DBSession
,
get_params
from
..
import
DBSession
,
get_params
from
opensipkd.tools
import
dmy
,
d
my_to_date
,
get_settings
,
get_ext
,
\
from
opensipkd.tools
import
dmy
,
d
ate_from_str
,
get_settings
,
get_ext
,
\
date_from_str
date_from_str
import
colander
import
colander
from
deform
import
(
widget
,
Form
,
ValidationFailure
,
Button
,
)
from
deform
import
(
widget
,
Form
,
ValidationFailure
,
Button
,
)
...
@@ -36,6 +36,12 @@ class BaseView(object):
...
@@ -36,6 +36,12 @@ class BaseView(object):
self
.
params
=
self
.
req
.
params
self
.
params
=
self
.
req
.
params
self
.
settings
=
get_settings
()
self
.
settings
=
get_settings
()
now
=
datetime
.
now
()
now
=
datetime
.
now
()
# self.dt_awal = self.ses["dt_awal"] if "dt_awal" in self.ses else now
# self.awal = dmy(self.dt_awal)
# self.dt_akhir = self.ses["dt_akhir"] if "dt_akhir" in self.ses else now
# self.akhir = dmy(self.dt_akhir)
# self.ses["dt_awal"] = self.dt_awal
# self.ses["dt_akhir"] = self.dt_akhir
self
.
tahun
=
'tahun'
in
self
.
ses
and
self
.
ses
[
'tahun'
]
or
now
.
strftime
(
self
.
tahun
=
'tahun'
in
self
.
ses
and
self
.
ses
[
'tahun'
]
or
now
.
strftime
(
'
%
Y'
)
'
%
Y'
)
self
.
tahun
=
'tahun'
in
self
.
params
and
self
.
params
[
self
.
tahun
=
'tahun'
in
self
.
params
and
self
.
params
[
...
@@ -47,7 +53,7 @@ class BaseView(object):
...
@@ -47,7 +53,7 @@ class BaseView(object):
if
'bulan'
in
self
.
params
and
self
.
params
[
'bulan'
]:
if
'bulan'
in
self
.
params
and
self
.
params
[
'bulan'
]:
self
.
bulan
=
self
.
params
[
'bulan'
]
.
strip
()
.
zfill
(
2
)
self
.
bulan
=
self
.
params
[
'bulan'
]
.
strip
()
.
zfill
(
2
)
dt_awal
=
d
my_to_date
(
dt_awal
=
d
ate_from_str
(
'{d}-{m}-{y}'
.
format
(
y
=
self
.
tahun
,
m
=
self
.
bulan
,
d
=
'01'
))
'{d}-{m}-{y}'
.
format
(
y
=
self
.
tahun
,
m
=
self
.
bulan
,
d
=
'01'
))
dt_akhir
=
dt_awal
+
relativedelta
(
months
=
1
)
-
relativedelta
(
days
=
1
)
dt_akhir
=
dt_awal
+
relativedelta
(
months
=
1
)
-
relativedelta
(
days
=
1
)
...
@@ -66,10 +72,10 @@ class BaseView(object):
...
@@ -66,10 +72,10 @@ class BaseView(object):
self
.
awal
=
'awal'
in
self
.
ses
and
self
.
ses
[
'awal'
]
or
dmy
(
now
)
self
.
awal
=
'awal'
in
self
.
ses
and
self
.
ses
[
'awal'
]
or
dmy
(
now
)
awal
=
'awal'
in
self
.
params
and
self
.
params
[
'awal'
]
or
self
.
awal
awal
=
'awal'
in
self
.
params
and
self
.
params
[
'awal'
]
or
self
.
awal
try
:
try
:
self
.
dt_awal
=
d
my_to_date
(
awal
)
self
.
dt_awal
=
d
ate_from_str
(
awal
)
self
.
awal
=
awal
self
.
awal
=
awal
except
:
except
:
self
.
dt_awal
=
d
my_to_date
(
self
.
awal
)
self
.
dt_awal
=
d
ate_from_str
(
self
.
awal
)
self
.
ses
[
'awal'
]
=
self
.
awal
self
.
ses
[
'awal'
]
=
self
.
awal
self
.
ses
[
'dt_awal'
]
=
self
.
dt_awal
self
.
ses
[
'dt_awal'
]
=
self
.
dt_awal
...
@@ -78,10 +84,10 @@ class BaseView(object):
...
@@ -78,10 +84,10 @@ class BaseView(object):
akhir
=
'akhir'
in
self
.
params
and
self
.
params
[
'akhir'
]
or
self
.
akhir
akhir
=
'akhir'
in
self
.
params
and
self
.
params
[
'akhir'
]
or
self
.
akhir
try
:
try
:
self
.
dt_akhir
=
d
my_to_date
(
akhir
)
self
.
dt_akhir
=
d
ate_from_str
(
akhir
)
self
.
akhir
=
akhir
self
.
akhir
=
akhir
except
:
except
:
self
.
dt_akhir
=
d
my_to_date
(
self
.
akhir
)
self
.
dt_akhir
=
d
ate_from_str
(
self
.
akhir
)
self
.
tahun_awal
=
'tahun_awal'
in
self
.
ses
and
self
.
ses
[
self
.
tahun_awal
=
'tahun_awal'
in
self
.
ses
and
self
.
ses
[
'tahun_awal'
]
or
self
.
tahun
'tahun_awal'
]
or
self
.
tahun
...
@@ -181,8 +187,8 @@ class BaseView(object):
...
@@ -181,8 +187,8 @@ class BaseView(object):
def
view_list
(
self
,
**
kwargs
):
def
view_list
(
self
,
**
kwargs
):
if
self
.
list_schema
:
if
self
.
list_schema
:
allow_edit
=
kwargs
.
get
(
"allow_edit"
,
True
)
allow_edit
=
kwargs
.
get
(
"allow_edit"
,
True
)
allow_delete
=
kwargs
.
get
(
"allow_delete"
,
True
)
allow_delete
=
kwargs
.
get
(
"allow_delete"
,
True
)
table
=
DeTable
(
self
.
list_schema
(),
table
=
DeTable
(
self
.
list_schema
(),
action
=
self
.
req
.
route_url
(
self
.
list_route
),
action
=
self
.
req
.
route_url
(
self
.
list_route
),
action_suffix
=
"/grid/act"
,
action_suffix
=
"/grid/act"
,
...
@@ -219,7 +225,7 @@ class BaseView(object):
...
@@ -219,7 +225,7 @@ class BaseView(object):
return
dict
(
form
=
form
.
render
(
readonly
=
True
),
return
dict
(
form
=
form
.
render
(
readonly
=
True
),
table
=
table
and
table
.
render
()
or
None
,
table
=
table
and
table
.
render
()
or
None
,
scripts
=
self
.
form_scripts
)
scripts
=
self
.
form_scripts
)
def
before_add
(
self
):
def
before_add
(
self
):
return
{}
return
{}
...
@@ -227,7 +233,7 @@ class BaseView(object):
...
@@ -227,7 +233,7 @@ class BaseView(object):
return
value
return
value
def
cancel_act
(
self
):
def
cancel_act
(
self
):
pass
return
self
.
route_list
()
def
after_add
(
self
,
row
,
values
):
def
after_add
(
self
,
row
,
values
):
return
return
...
@@ -244,12 +250,12 @@ class BaseView(object):
...
@@ -244,12 +250,12 @@ class BaseView(object):
def
view_act
(
self
,
**
kwargs
):
def
view_act
(
self
,
**
kwargs
):
url_dict
=
self
.
req
.
matchdict
url_dict
=
self
.
req
.
matchdict
if
url_dict
[
'act'
]
==
'grid'
:
if
url_dict
[
'act'
]
==
'grid'
:
url
=
[]
url
=
[]
columns
=
[]
columns
=
[]
for
d
in
self
.
list_schema
():
for
d
in
self
.
list_schema
():
global_search
=
hasattr
(
d
,
"searchable"
)
and
\
global_search
=
hasattr
(
d
,
"searchable"
)
and
\
hasattr
(
d
,
"searchable"
)
==
False
and
False
\
hasattr
(
d
,
"searchable"
)
==
False
and
False
\
or
True
or
True
if
hasattr
(
d
,
"field"
):
if
hasattr
(
d
,
"field"
):
if
type
(
d
.
field
)
==
str
:
if
type
(
d
.
field
)
==
str
:
columns
.
append
(
columns
.
append
(
...
@@ -268,7 +274,7 @@ class BaseView(object):
...
@@ -268,7 +274,7 @@ class BaseView(object):
self
.
table
,
"company_id"
):
self
.
table
,
"company_id"
):
query
=
query
.
filter
(
query
=
query
.
filter
(
self
.
table
.
company_id
==
self
.
req
.
user
.
company_id
)
self
.
table
.
company_id
==
self
.
req
.
user
.
company_id
)
query
=
self
.
list_filter
(
query
)
query
=
self
.
list_filter
(
query
)
row_table
=
DataTables
(
self
.
req
.
GET
,
query
,
columns
)
row_table
=
DataTables
(
self
.
req
.
GET
,
query
,
columns
)
result
=
row_table
.
output_result
()
result
=
row_table
.
output_result
()
# for d in result["data"]:
# for d in result["data"]:
...
@@ -301,7 +307,7 @@ class BaseView(object):
...
@@ -301,7 +307,7 @@ class BaseView(object):
values
=
dict
(
c
)
values
=
dict
(
c
)
row
=
self
.
save_request
(
values
)
row
=
self
.
save_request
(
values
)
self
.
after_add
(
row
,
values
)
self
.
after_add
(
row
,
values
)
elif
"cancel"
in
self
.
req
.
POST
or
'batal'
in
self
.
req
.
POST
:
elif
"cancel"
in
self
.
req
.
POST
or
'batal'
in
self
.
req
.
POST
or
"close"
in
self
.
req
.
POST
:
self
.
cancel_act
()
self
.
cancel_act
()
else
:
else
:
return
self
.
next_add
(
form
,
table
=
table
,
resources
=
resources
)
return
self
.
next_add
(
form
,
table
=
table
,
resources
=
resources
)
...
@@ -407,7 +413,8 @@ class BaseView(object):
...
@@ -407,7 +413,8 @@ class BaseView(object):
DBSession
.
flush
()
DBSession
.
flush
()
request
.
session
.
flash
(
msg
)
request
.
session
.
flash
(
msg
)
return
self
.
route_list
()
return
self
.
route_list
()
form
=
self
.
get_form
(
self
.
edit_schema
,
buttons
=
(
btn_delete
,
btn_cancel
))
form
=
self
.
get_form
(
self
.
edit_schema
,
buttons
=
(
btn_delete
,
btn_cancel
))
table
=
self
.
get_item_table
(
row
)
table
=
self
.
get_item_table
(
row
)
resources
=
form
.
get_widget_resources
()
resources
=
form
.
get_widget_resources
()
form
.
set_appstruct
(
self
.
get_values
(
row
))
form
.
set_appstruct
(
self
.
get_values
(
row
))
...
...
opensipkd/detable/detable.py
View file @
6f0008b
...
@@ -178,6 +178,22 @@ class DeTable(field.Field):
...
@@ -178,6 +178,22 @@ class DeTable(field.Field):
if
hasattr
(
f
,
'visible'
):
if
hasattr
(
f
,
'visible'
):
d
[
"visible"
]
=
f
.
visible
d
[
"visible"
]
=
f
.
visible
data
.
append
(
f
"visible: {f.visible}"
)
data
.
append
(
f
"visible: {f.visible}"
)
if
hasattr
(
f
,
'orderable'
):
d
[
"orderable"
]
=
f
.
orderable
data
.
append
(
f
"orderable: {f.orderable}"
)
if
hasattr
(
f
,
"url"
):
request
=
kw
.
get
(
"request"
)
if
request
:
d
[
"url"
]
=
request
.
static_url
(
f
.
url
)
log
.
debug
(
d
[
"url"
])
if
hasattr
(
f
,
"action"
):
d
[
"action"
]
=
f
.
action
else
:
d
[
"action"
]
=
True
if
isinstance
(
f
.
widget
,
deform
.
widget
.
HiddenWidget
):
if
isinstance
(
f
.
widget
,
deform
.
widget
.
HiddenWidget
):
d
[
"visible"
]
=
False
d
[
"visible"
]
=
False
if
isinstance
(
f
.
widget
,
deform
.
widget
.
CheckboxWidget
):
if
isinstance
(
f
.
widget
,
deform
.
widget
.
CheckboxWidget
):
...
@@ -185,9 +201,8 @@ class DeTable(field.Field):
...
@@ -185,9 +201,8 @@ class DeTable(field.Field):
else
:
else
:
d
[
"checkbox"
]
=
False
d
[
"checkbox"
]
=
False
if
hasattr
(
f
,
'orderable'
):
d
[
"orderable"
]
=
f
.
orderable
data
.
append
(
f
"orderable: {f.orderable}"
)
thousand
=
hasattr
(
f
,
'thousand'
)
and
f
.
thousand
or
None
thousand
=
hasattr
(
f
,
'thousand'
)
and
f
.
thousand
or
None
separator
=
thousand
and
"separator"
in
thousand
and
thousand
[
separator
=
thousand
and
"separator"
in
thousand
and
thousand
[
...
...
opensipkd/detable/templates/detable.pt
View file @
6f0008b
<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'};
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;
...
@@ -18,53 +19,69 @@
...
@@ -18,53 +19,69 @@
allow_edit allow_edit|field.allow_edit;
allow_edit allow_edit|field.allow_edit;
allow_delete allow_delete|field.allow_delete;
allow_delete allow_delete|field.allow_delete;
"
"
tal:attributes="style style; class css_class; attributes|field.widget.attributes|{};"
tal:attributes="style style; class css_class; attributes|field.widget.attributes|{};"
i18n:domain="detable">
i18n:domain="detable"
<header role="heading" class="txt-color-grayDark">
>
<h2 tal:condition="title">
<header role="heading" class="txt-color-grayDark">
<i class="fa fa-fw fa-table"></i>${title}
<h2 tal:condition="title"><i class="fa fa-fw fa-table"></i>${title}</h2>
</h2>
<div role="content">
<div role="content">
<div class="widget-body">
<div class="widget-body">
<table
<table id="${tableid}"
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>
>
<tr>
<thead>
<th tal:repeat="child field">${child.title}</th>
<tr>
</tr>
<th tal:repeat="child field">${child.title}</th>
</thead>
</tr>
<tbody>
</thead>
</tbody>
<tbody></tbody>
</table>
</table>
</div>
<!-- widget-body -->
</div>
</header>
</div> <!-- widget-body -->
<script type="text/javascript">
</div>
deform.addCallback
</header>
('${tableid}', function (oid) {
let m${tableid}ID;
let o${tableid};
let o${tableid}Uri = "${url}";
let o${tableid}Url = o${tableid}Uri + "${url_suffix}";
let tb_array = [
'<div class="btn-group pull-left">',
'${structure:buttons}',
' ',
'</div>',
]
let columns = ${structure: columns};
<script>
function render_checkbox(value) {
deform.addCallback
if (value == true) {
('${tableid}', function (oid) {
return '<i class="fas fa-check-square" aria-hidden="true">';
let m${tableid}ID;
let o${tableid};
let o${tableid}Uri = "${url}";
let o${tableid}Url = o${tableid}Uri + "${url_suffix}";
let tb_array = [
'<div class="btn-group pull-left">',
'${structure:buttons}',
' ',
'</div>',
]
let columns = ${structure: columns};
function render_checkbox(value) {
if (value == true) {
return '<i class="fas fa-check-square" aria-hidden="true">';
}
return '<i class="fas fa-rectangle-xmark" aria-hidden="true">';
}
}
return 'Archived';
}
if (columns[0].data == "id") {
for (co in columns) {
columns[0].render = function (id) {
console.log(columns[co]);
if (columns[co].checkbox === true) {
columns[co].className = "text-center";
columns[co].width = "30pt";
columns[co].render = function (val) {
if (["", false, 0].indexOf(val) === -1) {
return render_checkbox(true);
} else return render_checkbox(false);
}
}else if (columns[co].hasOwnProperty("url")){
let url = columns[co].url;
columns[co].render = function (data) {
let result = '<a href="'+url+'/' + data + '" target="_blank">'+data+'</a> ';
return result;
}
}else if(columns[co].data == "id" && columns[co].action == true){
columns[co].render = function (id) {
let result = '<a href="${url}/' + id + '/view"><i class="fas fa-eye" aria-hidden="true"></i></a> ';
let result = '<a href="${url}/' + id + '/view"><i class="fas fa-eye" aria-hidden="true"></i></a> ';
if (${allow_edit}) {
if (${allow_edit}) {
result += '<a href="${url}/' + id + '/edit"><i class="fas fa-edit" aria-hidden="true"></i></a> '
result += '<a href="${url}/' + id + '/edit"><i class="fas fa-edit" aria-hidden="true"></i></a> '
...
@@ -75,83 +92,72 @@
...
@@ -75,83 +92,72 @@
return result;
return result;
}
}
columns[0].width = "40pt";
columns[co].width = "30pt";
columns[0].orderable = false;
columns[co].orderable = false;
columns[0].className = "text-center";
columns[co].className = "text-center";
columns[0].visible = true;
columns[co].visible = true;
columns[1].order = "order_asc";
//columns[1].order = "order_asc";
}
for (co in columns) {
if (columns[co].checkbox === true) {
columns[co].className = "text-center";
columns[co].width = "30pt";
columns[co].render = function (val) {
if (["", false, 0].indexOf(val) === -1) {
return render_checkbox(true);
} else return render_checkbox(false);
}
}
}
console.log(columns);
let language = {
"search": "Cari: ",
"paginate": {
"first": '<span class="glyphicon glyphicon-step-backward"></span> ',
"last": '<span class="glyphicon glyphicon glyphicon-step-forward"></span> ',
"previous": '<span class="glyphicon glyphicon-backward"></span> ',
"next": '<span class="glyphicon glyphicon-forward"></span> ',
},
"lengthMenu": " _MENU_ baris "
};
let params = {
dom: '<"row"<"col-md-8"<"toolbar">Bl><"col-md-4"fr>>tip',
processing: true,
serverSide: ${server_side},
stateSave: false,
scrollCollapse: true,
sort: ${sorts},
info: false,
filter: ${filters},
autoWidth: false,
paginate: ${paginates},
paginationType: "full_numbers",
order: [],
lengthMenu: [
[10, 25, 50, 100],
[10, 25, 50, 100]
],
columns: columns,
"language": language,
}
}
if (${server_side}==false
}
)
let language = {
{
"search": "Cari: ",
params.data = ${data};
"paginate": {
}
"first": '<span class="glyphicon glyphicon-step-backward"></span> ',
else
"last": '<span class="glyphicon glyphicon glyphicon-step-forward"></span> ',
{
"previous": '<span class="glyphicon glyphicon-backward"></span> ',
params.ajax = o${tableid}Url;
"next": '<span class="glyphicon glyphicon-forward"></span> ',
},
"lengthMenu": " _MENU_ baris "
};
let params = {
dom: '<"row"<"col-md-8"<"toolbar">Bl><"col-md-4"fr>>tip',
processing: true,
serverSide: ${server_side},
stateSave: false,
scrollCollapse: true,
sort: ${sorts},
info: false,
filter: ${filters},
autoWidth: false,
paginate: ${paginates},
paginationType: "full_numbers",
order: [],
lengthMenu: [
[10, 25, 50, 100],
[10, 25, 50, 100]
],
columns: columns,
"language": language,
}
if (${server_side}==false
)
{
params.data = ${data};
}
else
{
params.ajax = o${tableid}Url;
}
o${tableid} = $('#${tableid}').DataTable(params);
let tb = tb_array.join(' ');
$("div.toolbar").html(tb);
$("div.toolbar").attr('style', 'display:block; float: left; margin-bottom:6px; line-height:16px;');
$('#${tableid} tbody').on('click', 'tr', function () {
if ($(this).hasClass('selected')) {
$(this).removeClass('selected');
} else {
let aData = o${tableid}.row(this).data();
o${tableid}.$('tr.selected').removeClass('selected');
$(this).addClass('selected');
m${tableid}ID = aData.id;
// console.log(mID);
o${tableid}.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
}
}
o${tableid} = $('#${tableid}').DataTable(params);
let tb = tb_array.join(' ');
$("div.toolbar").html(tb);
$("div.toolbar").attr('style', 'display:block; float: left; margin-bottom:6px; line-height:16px;');
$('#${tableid} tbody').on('click', 'tr', function () {
if ($(this).hasClass('selected')) {
$(this).removeClass('selected');
} else {
let aData = o${tableid}.row(this).data();
o${tableid}.$('tr.selected').removeClass('selected');
$(this).addClass('selected');
m${tableid}ID = aData.id;
// console.log(mID);
o${tableid}.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
}
});
${structure:btnscripts}
});
});
</script>
</div>
\ No newline at end of file
\ No newline at end of file
${structure:btnscripts}
});
</script>
</div>
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