Is there any way to access 'aoData' array?
Is there any way to access 'aoData' array?
Is there anyway to access the initial data used to build a table? To clarify, I am able to access table data via:
[code]
/* Get the data array for this row */
var aPos = oTable.fnGetPosition( this);
var aData = oTable.fnGetData(aPos);
[/code]
...but what I want to be able to do is look at the data initially used to build the table, not the rendered data. Has anyone done this?
[code]
/* Get the data array for this row */
var aPos = oTable.fnGetPosition( this);
var aData = oTable.fnGetData(aPos);
[/code]
...but what I want to be able to do is look at the data initially used to build the table, not the rendered data. Has anyone done this?
This discussion has been closed.
Replies
Allan
I just used fnSettings() and iterated over the returned object and aoData is the same as the "rendered" data contained in the table. Or I am overlooking a method. Maybe what I am looking for is not provided, but it seems like being able to correlate a table row to the "original" data would be useful.
Allan
I'm only getting the rendered, values not the original data.
I use:
[code]
var data = oTable.fnSettings().aoData[aPos]._aData;
console.log($(data));
[/code]
This gives me this result in the JQuery console:
log: jQuery("", "", "", "", "
In your code:
[code]
var data = oTable.fnSettings().aoData[aPos]._aData;
console.log($(data));
[/code]
_aData is an array of strings - so I don't really understand why you've wrapped it in a jQuery object?
Allan
re: "have you set bUseRendered: false for the column that you want to keep the original data in?" I _think_ that the answer is "sometimes yes" and "sometimes no". I am using aoColumns and on some columns (such as the "id" column) I am setting "bVisible": false" like so:
/* 1 -- id */ { "bVisible": false }.
Other columns, such as the ones where I am displaying a checkmark if the value in the JSON is equal to "1", are obviously being rendered as an image in the cell.
What I want to be able to do is read the original value "1" instead of the rendered value "
Allan
You should be a Zen Master.