Hello, everyone.
I have a matrix field which widget type is 'Table with headers and multiple rows'.
When I try to create the node, javasript has an error message :
Uncaught TypeError: Cannot read property 'colSpan' of undefined.
I check the code and find the error because of the 115 to 117 line of tabledrag.js:
var columnIndex = $('td', cell.parent()).index(cell.get(0)) + 1;
var headerIndex = $('td:not(:hidden)', cell.parent()).index(cell.get(0)) + 1;
$('tr', this.table).each(function(){
I guess it is because that matrix display a 'sub table' inside a simple table field and the index can not be calculated correctly.
For now I just add a code, with this my creating node could work.
var columnIndex = $('td:not(.matrix td)', cell.parent()).index(cell.get(0)) + 1;
var headerIndex = $('td:not(:hidden,.matrix td)', cell.parent()).index(cell.get(0)) + 1;
$('tr:not(.matrix tr)', this.table).each(function(){
Hope for a better solution to fix this bug because I think it's not a good way to modify a misc file directly.
Tks~
Comments
Comment #1
ydx commentedComment #2
intrafusionComment #2.0
intrafusionMiss one line to modify, else the column of table can not display correctly.
Comment #3
geekinpink commentedfield collection having widget type table is not working for even records but it works well with odd records
plz help me out