mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 06:18:44 +02:00
#770 and #853: When a list is configured directly from the table (NOT from the Dialog box), then these settings are not kept neither when creating a shortcut nor when opening the "configure this list" dialog
SVN:trunk[3030]
This commit is contained in:
@@ -240,6 +240,38 @@ $(function()
|
||||
// in 1.9 would use _super
|
||||
this._superApply(arguments);
|
||||
},
|
||||
UpdateState: function( config )
|
||||
{
|
||||
var iPageSize = config.page_size;
|
||||
if (iPageSize == -1)
|
||||
{
|
||||
iPageSize = 0;
|
||||
}
|
||||
this.options.iPageSize = iPageSize;
|
||||
|
||||
var iPos = 0;
|
||||
for (alias in this.options.oColumns)
|
||||
{
|
||||
for (attcode in this.options.oColumns[alias])
|
||||
{
|
||||
this.options.oColumns[alias][attcode]['sort'] = 'none';
|
||||
if (this.options.oColumns[alias][attcode]['checked'])
|
||||
{
|
||||
if (iPos == config.sort_index)
|
||||
{
|
||||
this.options.oColumns[alias][attcode]['sort'] = config.sort_order;
|
||||
}
|
||||
iPos++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var sId = new String(this.element.attr('id'));
|
||||
var sListId = sId.replace('datatable_', '');
|
||||
var dlgElement = $('#datatable_dlg_'+sListId);
|
||||
dlgElement.find('input[name=page_size]').val(iPageSize);
|
||||
dlgElement.find(':itop-fieldsorter').fieldsorter('option', { fields: this.options.oColumns });
|
||||
},
|
||||
_saveDlgState: function()
|
||||
{
|
||||
this.originalState = {};
|
||||
|
||||
@@ -176,6 +176,15 @@ function sprintf(format, etc) {
|
||||
s_col = s[0];
|
||||
s_order = (s[1] == 0) ? 'asc' : 'desc';
|
||||
}
|
||||
|
||||
var oDataTable = $(table).closest('table.itop-datatable');
|
||||
var oConfig = {
|
||||
sort_index: s_col,
|
||||
sort_order: s_order,
|
||||
page_size: table.config.selectedSize
|
||||
};
|
||||
oDataTable.datatable('UpdateState', oConfig);
|
||||
|
||||
$('#loading', table.config.container).html('<img src="../images/indicator.gif" />');
|
||||
table.ajax_request = $.post(AddAppContext(GetAbsoluteUrlAppRoot()+"pages/ajax.render.php"),
|
||||
{ operation: 'pagination',
|
||||
|
||||
Reference in New Issue
Block a user