- FilterWidget: added method reloadDataset() for reload of dataset only

This commit is contained in:
alex
2019-09-06 17:29:22 +02:00
parent 562e509875
commit 36ff38b0ee
3 changed files with 38 additions and 3 deletions
@@ -216,6 +216,16 @@ class Filters extends FHC_Controller
$this->outputJsonSuccess('Success');
}
/**
* Reloads the dataset
*/
public function reloadDataset()
{
$this->filterslib->reloadDataset();
$this->outputJsonSuccess('Success');
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
+8
View File
@@ -528,6 +528,14 @@ class FiltersLib
return $applyFilters;
}
/**
* Reloads dataset by setting session variable to true
*/
public function reloadDataset()
{
$this->setSessionElement(self::SESSION_RELOAD_DATASET, true);
}
/**
* Add a filter (SQL where clause) to be applied to the current filter
*/
+20 -3
View File
@@ -92,7 +92,7 @@ var FHC_FilterWidget = {
},
/**
* Alias call to method display only to inprove the readability of the code
* Alias call to method display only to improve the readability of the code
*/
refresh: function() {
@@ -100,13 +100,30 @@ var FHC_FilterWidget = {
},
/**
* To retrive the page where the FilterWidget is used, using the FHC_JS_DATA_STORAGE_OBJECT
* To retrieve the page where the FilterWidget is used, using the FHC_JS_DATA_STORAGE_OBJECT
*/
getFilterPage: function() {
return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method;
},
/**
* Reload of dataset, also reloads page to show changes
*/
reloadDataset: function() {
FHC_AjaxClient.ajaxCallPost(
"system/Filters/reloadDataset",
{
filter_page: FHC_FilterWidget.getFilterPage()
},
{
successCallback: function(data, textStatus, jqXHR) {
FHC_FilterWidget._failOrReload(data);
}
}
);
},
//------------------------------------------------------------------------------------------------------------------
// Private methods
@@ -197,7 +214,7 @@ var FHC_FilterWidget = {
},
/**
* This method calls all the other methods needed to rendere the GUI for a FilterWidget
* This method calls all the other methods needed to render the GUI for a FilterWidget
* The parameter data contains all the data about the FilterWidget and it is given as parameter
* to all the methods that here are called
* NOTE: think very carefully before changing the order of the calls