1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-04-01 06:50:25 +03:00

Bug #4409: Update user template only when page legth changes

This commit is contained in:
Carlos Martín 2016-06-01 17:41:53 +02:00
parent cafaeb4da6
commit 5bc4fc1cf0

View File

@ -182,6 +182,8 @@ define(function(require) {
*/
function _initialize(opts) {
var that = this;
if (this.conf.select) {
if (opts && opts.selectOptions) {
$.extend(this.selectOptions, opts.selectOptions);
@ -197,13 +199,14 @@ define(function(require) {
// Remember page length only for non selectable datatables
if (!this.conf.select) {
this.dataTable.on( 'length.dt', function ( e, settings, len ) {
config['user_config']['page_length'] = len;
var sunstone_setting = {'TABLE_DEFAULT_PAGE_LENGTH': len};
Sunstone.runAction("User.append_sunstone_setting", config['user_id'], sunstone_setting);
});
if (config['user_config']['page_length'] != len){
config['user_config']['page_length'] = len;
var sunstone_setting = {'TABLE_DEFAULT_PAGE_LENGTH': len};
Sunstone.runAction("User.append_sunstone_setting", config['user_id'], sunstone_setting);
}
});
}
var that = this;
$('#' + this.dataTableId + 'Search').on('input', function() {
that.dataTable.fnFilter($(this).val());
return false;