Update documentation
Update documentation
LeadVisionary
Posts: 8Questions: 0Answers: 0
The documentation for fnRender
http://www.datatables.net/usage/columns
states
- array:aData - the data for the row in question
Looking at this, one would expect the parameter to be a one dimensional array with indices corresponding to the columns. But to get to the column you want, you must use it like this:
[code]oObj.aData[oObj.iDataRow][oObj.iDataColumn][/code]
Array index 0 has the data for the row (anything beyond that is undefined), and the column is indexed from it. This is counter-intuitive. Suggestion to either reword "the data for the row in question", show a usage example, or both. Bigger suggestion: refactor the API (it doesn't make any sense to pass around a two dimensional array with only the first dimension filled in with data)
http://www.datatables.net/usage/columns
states
- array:aData - the data for the row in question
Looking at this, one would expect the parameter to be a one dimensional array with indices corresponding to the columns. But to get to the column you want, you must use it like this:
[code]oObj.aData[oObj.iDataRow][oObj.iDataColumn][/code]
Array index 0 has the data for the row (anything beyond that is undefined), and the column is indexed from it. This is counter-intuitive. Suggestion to either reword "the data for the row in question", show a usage example, or both. Bigger suggestion: refactor the API (it doesn't make any sense to pass around a two dimensional array with only the first dimension filled in with data)
This discussion has been closed.
Replies
I 110% agree with you that the arguments for this function completely suck. I totally regret the design decision originally made to do it that way, and I've not changed it as I don't want to break backwards compatibility with it. When DataTables 2 happens, then this will change!
Regards,
Allan