mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°2737 - Migrate table to DataTables plugin to be iso with the end-users portal - fix change in "configure this list"
This commit is contained in:
@@ -15,7 +15,7 @@ $(function()
|
||||
iPageSize: -1,
|
||||
oClassAliases: {},
|
||||
sTableId : null,
|
||||
oExtraParams: {},
|
||||
oData: {},
|
||||
sRenderUrl: 'index.php',
|
||||
oRenderParameters: {},
|
||||
oDefaultSettings: {},
|
||||
@@ -71,7 +71,6 @@ $(function()
|
||||
var me = this;
|
||||
this.element.block();
|
||||
|
||||
$('#'+me.options.sListId).DataTable().ajax.reload();
|
||||
$.post(this.options.sRenderUrl, oParams, function(data) {
|
||||
// Nasty workaround to clear the pager's state for paginated lists !!!
|
||||
// See jquery.tablesorter.pager.js / saveParams / restoreParams
|
||||
|
||||
@@ -37,7 +37,7 @@ class DataTable extends UIContentBlock
|
||||
|
||||
protected $aOptions;//list of specific options for display datatable
|
||||
protected $sAjaxUrl;
|
||||
protected $sAjaxData;
|
||||
protected $aAjaxData;
|
||||
protected $aDisplayColumns;
|
||||
protected $aResultColumns;
|
||||
|
||||
@@ -75,8 +75,8 @@ class DataTable extends UIContentBlock
|
||||
*/
|
||||
public function GetAjaxData(string $sName)
|
||||
{
|
||||
if (isset($this->sAjaxData[$sName])) {
|
||||
return $this->sAjaxData[$sName];
|
||||
if (isset($this->aAjaxData[$sName])) {
|
||||
return $this->aAjaxData[$sName];
|
||||
}
|
||||
return '';
|
||||
}
|
||||
@@ -86,15 +86,15 @@ class DataTable extends UIContentBlock
|
||||
*/
|
||||
public function GetJsonAjaxData(): string
|
||||
{
|
||||
return json_encode($this->sAjaxData);
|
||||
return json_encode($this->aAjaxData);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $sAjaxData
|
||||
*/
|
||||
public function SetAjaxData(array $sAjaxData): void
|
||||
public function SetAjaxData(array $aAjaxData): void
|
||||
{
|
||||
$this->sAjaxData = $sAjaxData;
|
||||
$this->aAjaxData = $aAjaxData;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -158,7 +158,4 @@ class DataTable extends UIContentBlock
|
||||
{
|
||||
$this->aOptions = $aOptions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -367,6 +367,8 @@ class DataTableFactory
|
||||
} else {
|
||||
$aOptions['sSelectedRows'] = '[]';
|
||||
}
|
||||
$aExtraParams['table_id']=$sTableId;
|
||||
$aExtraParams['list_id']=$sListId;
|
||||
|
||||
|
||||
$oDataTable->SetOptions($aOptions);
|
||||
@@ -612,12 +614,12 @@ class DataTableFactory
|
||||
public static function GetOptionsForRendering(array $aColumns, string $sSelectMode, string $sFilter, int $iLength, array $aClassAliases, array $aExtraParams)
|
||||
{
|
||||
$aOptions = [];
|
||||
$sTableId=$aExtraParams["table_id"];
|
||||
$sTableId = $aExtraParams["table_id"];
|
||||
$sListId = $aExtraParams["list_id"];
|
||||
$aColumnsDefinitions = [];
|
||||
$aColumnDefinition = [];
|
||||
|
||||
if ($sSelectMode!=""){
|
||||
if ($sSelectMode != ""){
|
||||
$aColumnDefinition["width"] = "auto";
|
||||
$aColumnDefinition["searchable"] = false;
|
||||
$aColumnDefinition["sortable"] = false;
|
||||
|
||||
Reference in New Issue
Block a user