0.0.55 add widget search_list
This commit is contained in:
@@ -64,6 +64,8 @@ function insertSearchList(data, ctrl_name) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function showSearchList() {
|
||||
let input_list = document.getElementsByClassName('input_list');
|
||||
if(input_list.classList.contains('show')){
|
||||
@@ -72,15 +74,30 @@ function showSearchList() {
|
||||
|
||||
}
|
||||
|
||||
function onblurInputField(event,el){
|
||||
|
||||
// if(el.classList.contains("from_country_container")){
|
||||
let search_list = document.getElementsByName(el.name + '_list')[0];
|
||||
let parent_event = $(event.explicitOriginalTarget).parents('.input_list' );
|
||||
if(!parent_event || parent_event[0] !== search_list){
|
||||
|
||||
search_list.classList.remove('show')
|
||||
}
|
||||
|
||||
// }
|
||||
}
|
||||
// function onblurInputField(event,el){
|
||||
//
|
||||
// // if(el.classList.contains("from_country_container")){
|
||||
// let search_list = document.getElementsByName(el.name + '_list')[0];
|
||||
// let parent_event = $(event.explicitOriginalTarget).parents('.input_list' );
|
||||
// if(!parent_event || parent_event[0] !== search_list){
|
||||
//
|
||||
// search_list.classList.remove('show')
|
||||
// }
|
||||
//
|
||||
// // }
|
||||
// }
|
||||
// function onblurInputField(el){
|
||||
//
|
||||
// // if(el.classList.contains("from_country_container")){
|
||||
// let search_list = document.getElementsByName(el.name + '_list')[0];
|
||||
// // let parent_event = $(event.explicitOriginalTarget).parents('.input_list' );
|
||||
// // if(!parent_event || parent_event[0] !== search_list){
|
||||
// //
|
||||
// // search_list.classList.remove('show')
|
||||
// // }
|
||||
// if(search_list.classList.contains('show')){
|
||||
// search_list.classList.remove('show')
|
||||
// }
|
||||
//
|
||||
// // }
|
||||
// }
|
||||
@@ -70,13 +70,18 @@
|
||||
<input
|
||||
oninput="searchTown(this)"
|
||||
{# onclick="showSearchList()"#}
|
||||
onblur="onblurInputField(event, this)"
|
||||
{# onblur="onblurInputField(this)"#}
|
||||
type="text"
|
||||
list="from_address_point"
|
||||
name="from_address_point_txt"
|
||||
{% if form.fields.from_address_point.required %} required{% endif %}
|
||||
id="id_from_address_point_txt"
|
||||
{% if form.cleaned_data.from_address_point_txt %}value="{{ form.cleaned_data.from_address_point_txt }}"{% endif %}
|
||||
/>
|
||||
<datalist id="from_address_point">
|
||||
|
||||
</datalist>
|
||||
|
||||
<div class="input_list" name="from_address_point_txt_list">
|
||||
</div>
|
||||
{% if form.errors and form.errors.from_address_point %}
|
||||
|
||||
6
templates/widgets/w_data_list_txt.html
Normal file
6
templates/widgets/w_data_list_txt.html
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
<option {% if form.cleaned_data.from_address_point_txt %}{% endif %} value="{{ id }}">
|
||||
{{ form.cleaned_data.from_address_point_txt }}
|
||||
</option>
|
||||
<option value=""></option>
|
||||
|
||||
Reference in New Issue
Block a user