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 76b43898
authored
Feb 10, 2025
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan auto complete
1 parent
b92ee29e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
6 deletions
opensipkd/base/__init__.py
opensipkd/base/views/register.py
opensipkd/base/views/widget_os.py
opensipkd/base/views/widgets/autocomplete_input_ms.pt
opensipkd/base/__init__.py
View file @
76b4389
...
@@ -522,7 +522,7 @@ def get_route_names(rows):
...
@@ -522,7 +522,7 @@ def get_route_names(rows):
def
get_children
(
rows
):
def
get_children
(
rows
):
_logging
.
debug
(
f
"Children: {dict(rows.__dict__)}"
)
#
_logging.debug(f"Children: {dict(rows.__dict__)}")
return
[
dict
(
return
[
dict
(
order_id
=
r
.
order_id
,
order_id
=
r
.
order_id
,
id
=
r
.
id
,
id
=
r
.
id
,
...
...
opensipkd/base/views/register.py
View file @
76b4389
...
@@ -31,8 +31,7 @@ from datetime import datetime
...
@@ -31,8 +31,7 @@ from datetime import datetime
import
colander
import
colander
from
deform
import
(
widget
,
FileData
,
ValidationFailure
)
from
deform
import
(
widget
,
FileData
,
ValidationFailure
)
from
opensipkd.pbb.esppt.tools
import
date_from_str
from
opensipkd.tools
import
Upload
,
mem_tmp_store
,
image_validator
,
date_from_str
from
opensipkd.tools
import
Upload
,
mem_tmp_store
,
image_validator
from
opensipkd.tools.buttons
import
btn_cancel
,
btn_register
,
btn_save
from
opensipkd.tools.buttons
import
btn_cancel
,
btn_register
,
btn_save
from
pyramid.httpexceptions
import
HTTPFound
from
pyramid.httpexceptions
import
HTTPFound
from
pyramid.i18n
import
TranslationStringFactory
from
pyramid.i18n
import
TranslationStringFactory
...
...
opensipkd/base/views/widget_os.py
View file @
76b4389
...
@@ -488,7 +488,7 @@ class MapWidget(Widget):
...
@@ -488,7 +488,7 @@ class MapWidget(Widget):
def
__init__
(
self
,
**
kw
):
def
__init__
(
self
,
**
kw
):
super
()
.
__init__
(
**
kw
)
super
()
.
__init__
(
**
kw
)
_logging
.
info
(
self
.
gmap_data_style
)
_logging
.
debug
(
self
.
gmap_data_style
)
self
.
gmap_data_style
=
json
.
dumps
(
self
.
gmap_data_style
)
self
.
gmap_data_style
=
json
.
dumps
(
self
.
gmap_data_style
)
def
serialize
(
self
,
field
,
cstruct
,
**
kw
):
def
serialize
(
self
,
field
,
cstruct
,
**
kw
):
...
@@ -505,7 +505,7 @@ class MapWidget(Widget):
...
@@ -505,7 +505,7 @@ class MapWidget(Widget):
"removable"
:
not
readonly
,
"removable"
:
not
readonly
,
}
}
self
.
gmap_data_style
=
json
.
dumps
(
gmap_data_style
)
self
.
gmap_data_style
=
json
.
dumps
(
gmap_data_style
)
_logging
.
info
(
self
.
gmap_data_style
)
_logging
.
debug
(
self
.
gmap_data_style
)
values
=
self
.
get_template_values
(
field
,
cstruct
,
kw
)
values
=
self
.
get_template_values
(
field
,
cstruct
,
kw
)
return
field
.
renderer
(
template
,
**
values
)
return
field
.
renderer
(
template
,
**
values
)
...
...
opensipkd/base/views/widgets/autocomplete_input_ms.pt
View file @
76b4389
...
@@ -18,13 +18,28 @@
...
@@ -18,13 +18,28 @@
deform.addCallback(
deform.addCallback(
'${oid}',
'${oid}',
function (oid) {
function (oid) {
$('#' + oid + '-auto_value').typeahead(${
structure: options
});
$('#' + oid + '-auto_value').typeahead(${
structure: options
});
if ("${autofocus}" == "autofocus") {
if ("${autofocus}" == "autofocus") {
$('#' + oid + '-auto_value').focus();
$('#' + oid + '-auto_value').focus();
}
}
$('#' + oid + '-auto_value').bind('typeahead:selected', function (obj, datum, name) {
$('#' + oid + '-auto_value').bind('typeahead:selected', function (obj, datum, name) {
$('#' + oid + '-auto_id').val(datum.id);
$('#' + oid + '-auto_id').val(datum.id);
var not_check = ["id", "value"];
$.each(datum, function (key, val) {
if (!not_check.includes(key)) {
var ele = $('#' + key);
if (ele !== undefined) {
var eleName = ele.prop('nodeName').toLowerCase();
if (eleName === "select")
$("#" + key).val(val).trigger("change");
else if (eleName === "input")
$("#" + key).val(val);
else
$("#" + key).text(val);
}
}
});
$('#' + oid + '-auto_id').change();
$('#' + oid + '-auto_id').change();
});
});
...
...
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