#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:
Romain Quetiez
2013-12-09 20:38:05 +00:00
parent 3b188524ca
commit 2e37ccc4c2
2 changed files with 41 additions and 0 deletions

View File

@@ -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 = {};