mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
Fix actions over grid always return the last row DOMNode, by passing DOMNode to et2_action_object_impl constructor for cases like the infamous loop problem (JS closure)
This commit is contained in:
parent
e789a8f3ee
commit
d500e4cc91
@ -704,12 +704,16 @@ var et2_surroundingsMgr = Class.extend(
|
||||
* The class extension is different than the widgets
|
||||
*
|
||||
* @param {et2_DOMWidget} widget
|
||||
* @param {Object} node
|
||||
*
|
||||
*/
|
||||
function et2_action_object_impl(widget)
|
||||
function et2_action_object_impl(widget, node)
|
||||
{
|
||||
var aoi = new egwActionObjectInterface();
|
||||
var objectNode = node;
|
||||
|
||||
aoi.doGetDOMNode = function() {
|
||||
return widget.getDOMNode();
|
||||
return objectNode?objectNode:widget.getDOMNode();
|
||||
};
|
||||
|
||||
// _outerCall may be used to determine, whether the state change has been
|
||||
@ -732,7 +736,7 @@ function et2_action_object_impl(widget)
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
return aoi;
|
||||
};
|
||||
|
@ -881,9 +881,9 @@ var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned],
|
||||
for(var i = 0; i < this.rowData.length; i++)
|
||||
{
|
||||
// Add a new action object to the object manager
|
||||
var aoi = new et2_action_object_impl(this);
|
||||
var row = $j('tr', this.tbody)[i];
|
||||
aoi.doGetDOMNode = function() { return row;};
|
||||
var aoi = new et2_action_object_impl(this, row);
|
||||
|
||||
var obj = widget_object.addObject("row_"+i, aoi);
|
||||
obj.updateActionLinks(action_links);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user