mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-18 11:58:24 +01:00
fix actions got wrong row, if thead/tfooter (part attribute != "body") was used
This commit is contained in:
parent
021d992463
commit
999b0a7083
@ -953,28 +953,25 @@ var et2_grid = (function(){ "use strict"; return et2_DOMWidget.extend([et2_IDeta
|
|||||||
// 'allowed' for this widget at this time
|
// 'allowed' for this widget at this time
|
||||||
var action_links = this._get_action_links(actions);
|
var action_links = this._get_action_links(actions);
|
||||||
|
|
||||||
// Deal with each row
|
// Deal with each row in tbody, ignore action-wise rows in thead or tfooter for now
|
||||||
for(var i = 0; i < this.rowData.length; i++)
|
for(var i = 0, r = 0; i < this.rowData.length; i++)
|
||||||
{
|
{
|
||||||
// Add a new action object to the object manager
|
if (this.rowData[i].part != 'body') continue;
|
||||||
var row = $j('tr', this.tbody)[i];
|
|
||||||
var aoi = new et2_action_object_impl(this, row);
|
|
||||||
var id = "row_"+i;
|
|
||||||
var content = this.getArrayMgr('content').getEntry(i);
|
var content = this.getArrayMgr('content').getEntry(i);
|
||||||
if(content && content.id)
|
|
||||||
{
|
|
||||||
id = content.id;
|
|
||||||
}
|
|
||||||
var obj = widget_object.addObject(id, aoi);
|
|
||||||
|
|
||||||
// Set the data to the content so it's available for the action
|
|
||||||
if(content)
|
if(content)
|
||||||
{
|
{
|
||||||
|
// Add a new action object to the object manager
|
||||||
|
var row = $j('tr', this.tbody)[r];
|
||||||
|
var aoi = new et2_action_object_impl(this, row);
|
||||||
|
var obj = widget_object.addObject(content.id || "row_"+r, aoi);
|
||||||
|
|
||||||
|
// Set the data to the content so it's available for the action
|
||||||
obj.data = content;
|
obj.data = content;
|
||||||
}
|
|
||||||
|
|
||||||
obj.updateActionLinks(action_links);
|
obj.updateActionLinks(action_links);
|
||||||
}
|
}
|
||||||
|
r++;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user