Skip to content

Commit

Permalink
Fix ControlQueryList
Browse files Browse the repository at this point in the history
  • Loading branch information
UmSenhorQualquer committed Feb 22, 2019
1 parent 13599a7 commit f287066
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pyforms_web/web/static/pyforms.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions pyforms_web/web/static/pyformsjs/ControlQueryList.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class ControlQueryList extends ControlBase{
choose_button.children('span').html(filter_value);

self.collect_filters_values();
self.update_server_flag = true;
self.basewidget.fire_event( self.name, 'filter_changed_event' );
});

Expand All @@ -127,6 +128,7 @@ class ControlQueryList extends ControlBase{
$(this).hide();

self.collect_filters_values();
self.update_server_flag = true;
self.basewidget.fire_event( self.name, 'filter_changed_event' );
});
}
Expand Down Expand Up @@ -224,6 +226,7 @@ class ControlQueryList extends ControlBase{
$("#"+this.control_id()+"-search").keypress(function (ev) {
var keycode = (ev.keyCode ? ev.keyCode : ev.which);
if (keycode == '13') {
self.update_server_flag = true;
self.properties.search_field_key = $(this).val();
self.basewidget.fire_event( self.name, 'filter_changed_event' );
return false;
Expand All @@ -233,6 +236,8 @@ class ControlQueryList extends ControlBase{
$( "#"+this.place_id()+" .queryset-filter" ).dropdown({
onChange: function(value, text, selectedItem){
self.collect_filters_values();
self.update_server_flag = true;

self.basewidget.fire_event( self.name, 'filter_changed_event' );
},
fullTextSearch: 'exact',
Expand Down Expand Up @@ -269,6 +274,8 @@ class ControlQueryList extends ControlBase{
};
});


self.update_server_flag = true;
self.basewidget.fire_event( self.name, 'sort_changed_event' );
});

Expand Down Expand Up @@ -372,6 +379,7 @@ class ControlQueryList extends ControlBase{

$("#"+this.control_id()+" .pagination .item" ).click(function(){
if( !$(this).hasClass('active') ){
self.update_server_flag = true;
self.properties.pages.current_page = $(this).attr('pageindex');
self.basewidget.fire_event( self.name, 'page_changed_event' );
}
Expand Down

0 comments on commit f287066

Please sign in to comment.