Fix hidden nm with no initial rows were requesting data too early

This commit is contained in:
nathan 2022-11-07 14:51:42 -07:00
parent f2c763dc4d
commit 104680c477
3 changed files with 18 additions and 8 deletions

View File

@ -65,12 +65,13 @@ class admin_ui
'placeholder_actions' => array('add') 'placeholder_actions' => array('add')
); );
$content['groups'] = array( $content['groups'] = array(
'get_rows' => 'admin_ui::get_groups', 'get_rows' => 'admin_ui::get_groups',
'no_cat' => true, 'no_cat' => true,
'no_filter' => true, 'no_filter' => true,
'no_filter2' => true, 'no_filter2' => true,
'row_id' => 'account_id', 'num_rows' => 0,
'actions' => self::group_actions(), 'row_id' => 'account_id',
'actions' => self::group_actions(),
'placeholder_actions' => array('add') 'placeholder_actions' => array('add')
); );

View File

@ -500,6 +500,7 @@ class AdminApp extends EgwApp
{ {
this.nm.set_disabled(true); this.nm.set_disabled(true);
this.groups.set_disabled(false); this.groups.set_disabled(false);
jQuery(this.et2.parentNode).trigger('show.et2_nextmatch');
} }

View File

@ -2428,10 +2428,18 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
// TODO this.controller.setFilters(this.activeFilters); // TODO this.controller.setFilters(this.activeFilters);
// If no data was sent from the server, and num_rows is 0, the nm will be empty. // If no data was sent from the server, and num_rows is 0, the nm will be empty.
// This triggers a cache check. // This triggers a cache check if visible
if(!this.options.settings.num_rows && this.controller) if(!this.options.settings.num_rows && this.controller)
{ {
this.controller.update(); if(jQuery(this.getDOMNode()).filter(":visible").length > 0)
{
this.controller.update();
}
else
{
// Not visible, queue it up
this._queue_refresh([], et2_nextmatch.EDIT);
}
} }
// Load the default sort order // Load the default sort order