Remove all actions before setting to prevent conflicts between old and new actions with the same id

Also update existing row actions (fixes issue with r52449)
This commit is contained in:
Hadi Nategh 2015-04-15 08:31:55 +00:00
parent b1333232a7
commit a65d416807
2 changed files with 18 additions and 0 deletions

View File

@ -1688,6 +1688,10 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput, et2_IPrin
set_actions: function(actions) {
if(actions != this.options.actions && this.controller != null && this.controller._actionManager)
{
for(var i = this.controller._actionManager.children.length - 1; i >= 0; i--)
{
this.controller._actionManager.children[i].remove();
}
this.options.actions = actions;
this.options.settings.action_links = this.controller._actionLinks = this._get_action_links(actions);

View File

@ -285,6 +285,20 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider,
| EGW_AO_FLAG_DEFAULT_FOCUS | EGW_AO_FLAG_IS_CONTAINER;
this._init_links_dnd(this._actionManager);
if(this._selectionMgr)
{
// Need to update the action links for every registered row too
for (var uid in this._selectionMgr._registeredRows)
{
// Get the corresponding entry from the registered rows array
var entry = this._selectionMgr._getRegisteredRowsEntry(uid);
if(entry.ao)
{
entry.ao.updateActionLinks(this._actionLinks);
}
}
}
},
/**