fnUpdate when there are "action" columns

fnUpdate when there are "action" columns

blockheadblockhead Posts: 4Questions: 0Answers: 0
edited August 2011 in Bug reports
I have table set up with two "action" columns, for editing and deleting.

So my table looks like this:
[code]
aaData: this.model.schools.toJSON(),
aoColumns: [
{
mDataProp:'schoolName'
},
{
mDataProp: null,
fnRender: function() {
return 'Edit';
},
bSortable: false
}
]
[/code]

When I try to use fnUpdate like this

[code]fnUpdate(school,nRow)[/code]

I get an error:

[code]
Requested unknown parameter 'schoolName' from the data source for row 1
[/code]

Tracing this through the code, the code seems to be going in an infinite loop, because _fnGetCellData is returning null for the action column,
and null is an object so [code]else if ( typeof mData == 'object' )[/code] is true

and it thinks this is an object we have to loop through again for set each individual cell.

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    what is the value of school in your fnUpdate call?
  • blockheadblockhead Posts: 4Questions: 0Answers: 0
    {schoolID:1,schoolName:'A school'}
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    I think you're right.

    try setting sDefaultContent on that column and see if that avoids the error (jquery.dataTables.js:6595)
  • blockheadblockhead Posts: 4Questions: 0Answers: 0
    This solves it, thanks.
  • allanallan Posts: 63,386Questions: 1Answers: 10,449 Site admin
    This should be fixed in the current nightly. I had forgotten that typeof null == object in Javascript...

    Allan
This discussion has been closed.