mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Instead of re-rendering CRM infolog list, just use javascript to update the filter.
Faster, and avoids destroying the addressbook etemplate2 object by loading the infolog into it.
This commit is contained in:
parent
08424b0307
commit
56169beb2e
@ -2162,6 +2162,15 @@ window.egw_LAB.wait(function() {
|
||||
));
|
||||
}
|
||||
$content['index'] = $query['start'];
|
||||
|
||||
// Infolog nextmatch is already there, just update the filter
|
||||
if($contact_id && egw_json_request::isJSONRequest())
|
||||
{
|
||||
egw_json_response::get()->apply('app.addressbook.view_set_infolog',Array($contact_id));
|
||||
|
||||
// Clear contact_id, it's used as a flag to send infolog
|
||||
unset($contact_id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -92,6 +92,25 @@ app.classes.addressbook = AppJS.extend(
|
||||
this.egw.open(id, 'addressbook', 'view', {index: index}, '_self', 'addressbook');
|
||||
},
|
||||
|
||||
/**
|
||||
* Set link filter for the already open & rendered infolog list
|
||||
*
|
||||
* @param {string} contact_id New contact ID
|
||||
*/
|
||||
view_set_infolog: function(contact_id)
|
||||
{
|
||||
// Find the infolog list
|
||||
var infolog = etemplate2.getById(
|
||||
$j(this.et2.getInstanceManager().DOMContainer).next('.et2_container').attr('id')
|
||||
);
|
||||
var nm = null;
|
||||
if(infolog != null && (nm = infolog.widgetContainer.getWidgetById('nm')))
|
||||
{
|
||||
// Update the link filter to new contact
|
||||
nm.applyFilters({col_filter: {linked: 'addressbook:'+contact_id}});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Run an action from CRM view toolbar
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user