Skip to content
Extraits de code Groupes Projets
Valider 1149f26a rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Refs #3388, fix subtable loading regression and add docs explaining how id is set to datatable.js.

parent b6540ab0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -14,7 +14,20 @@ function dataTable() { ...@@ -14,7 +14,20 @@ function dataTable() {
this.param = {}; this.param = {};
} }
//Prototype of the DataTable object /**
* This class contains the client side logic for viewing and interacting with
* Piwik datatables.
*
* The id attribute for DataTables is set dynamically by the DataTableManager
* class, and this class instance is stored using the jQuery $.data function
* with the 'piwikDataTable' key.
*
* To find a datatable element by report (ie, 'UserSettings.getBrowser'),
* use piwik.DataTableManager.getDataTableByReport.
*
* To get the dataTable JS instance (an instance of this class) for a
* datatable HTML element, use $(element).data('piwikDataTable').
*/
dataTable.prototype = dataTable.prototype =
{ {
//initialisation function //initialisation function
...@@ -1161,7 +1174,9 @@ dataTable.prototype = ...@@ -1161,7 +1174,9 @@ dataTable.prototype =
self.param.idSubtable = idSubTable; self.param.idSubtable = idSubTable;
self.param.action = self.param.controllerActionCalledWhenRequestSubTable; self.param.action = self.param.controllerActionCalledWhenRequestSubTable;
self.reloadAjaxDataTable(false); self.reloadAjaxDataTable(false, function(response) {
self.dataTableLoaded(response, divIdToReplaceWithSubTable);
});
self.param.action = savedActionVariable; self.param.action = savedActionVariable;
delete self.param.idSubtable; delete self.param.idSubtable;
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
/** /**
* The DataTableManager class manages the initialization of JS dataTable * The DataTableManager class manages the initialization of JS dataTable
* instances. It's main purpose is to give each dataTable div a unique ID * instances. It's main purpose is to give each dataTable div a unique ID.
* when it's possible that any report will be loaded via AJAX, some more * This is done in the browser since it's possible for any report to be
* than once. * loaded via AJAX, some more than once.
* *
* The singleton instance can be accessed via piwik.DataTableManager. * The singleton instance can be accessed via piwik.DataTableManager.
*/ */
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter