mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 16:44:28 +00:00
- FilterWidget: added method reloadDataset() for reload of dataset only
This commit is contained in:
@@ -216,6 +216,16 @@ class Filters extends FHC_Controller
|
|||||||
$this->outputJsonSuccess('Success');
|
$this->outputJsonSuccess('Success');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reloads the dataset
|
||||||
|
*/
|
||||||
|
public function reloadDataset()
|
||||||
|
{
|
||||||
|
$this->filterslib->reloadDataset();
|
||||||
|
|
||||||
|
$this->outputJsonSuccess('Success');
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------------------------
|
||||||
// Private methods
|
// Private methods
|
||||||
|
|
||||||
|
|||||||
@@ -528,6 +528,14 @@ class FiltersLib
|
|||||||
return $applyFilters;
|
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
|
* Add a filter (SQL where clause) to be applied to the current filter
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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() {
|
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() {
|
getFilterPage: function() {
|
||||||
|
|
||||||
return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method;
|
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
|
// 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
|
* The parameter data contains all the data about the FilterWidget and it is given as parameter
|
||||||
* to all the methods that here are called
|
* to all the methods that here are called
|
||||||
* NOTE: think very carefully before changing the order of the calls
|
* NOTE: think very carefully before changing the order of the calls
|
||||||
|
|||||||
Reference in New Issue
Block a user