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 0d37fc4d
authored
Sep 09, 2024
by
Ari Agung Prasetiyo
Committed by
Ari Agung Prasetiyo
Sep 09, 2024
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
widget os - money input
1 parent
b235a8da
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
opensipkd/base/views/widget_os.py
opensipkd/base/views/widgets/readonly/money_input.pt
opensipkd/base/views/widget_os.py
View file @
0d37fc4
...
...
@@ -172,10 +172,12 @@ class BlokKavNoWidget(Widget):
result
=
"|"
.
join
([
blok_kav_no
,
rt
,
rw
])
if
not
rt
:
raise
Invalid
(
field
.
schema
,
"RT harus diisi. Minimal 000"
,
result
)
raise
Invalid
(
field
.
schema
,
"RT harus diisi. Minimal 000"
,
result
)
if
not
rw
:
raise
Invalid
(
field
.
schema
,
"RW harus diisi. Minimal 00"
,
result
)
raise
Invalid
(
field
.
schema
,
"RW harus diisi. Minimal 00"
,
result
)
# if not blok_kav_no or not rt or not rw:
# raise Invalid(field.schema, "Blok Kav No RT/RW tidak lengkap",
...
...
@@ -718,6 +720,10 @@ class DateInputWidget(WidgetDateInputWidget):
type_name
=
"text"
class
MoneyInputWidget
(
widget
.
MoneyInputWidget
):
readonly_template
=
"readonly/money_input"
# class AutocompleteInputWidget(widget.AutocompleteInputWidget):
# targets = None
# def serialize(self, field, cstruct, **kw):
...
...
opensipkd/base/views/widgets/readonly/money_input.pt
0 → 100644
View file @
0d37fc4
<p class="form-control-static" id="${oid|field.oid}">
</p>
<script type="text/javascript">
deform.addCallback(
'${oid|field.oid}',
function (oid) {
let val = parseInt('${cstruct}');
$("#" + oid).html(val.toLocaleString());
});
</script>
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