oData class reference

oData class reference

manifestmanifest Posts: 1Questions: 0Answers: 0
edited November 2009 in General
Where can I find oData class reference?
I need to get one of the values of table fields.
I get a selected row, I get a row object (oData), but as we now get one of row values?

[code]
function selectedRowIndex()
{
var nodes = dataTable_.fnGetNodes();
for(var index in nodes)
if($(nodes[index]).hasClass('row_selected'))
return parseInt(index);

return -1;
}

function test()
{
index = selectedRowIndex() + dataTable_.fnSettings()._iDisplayStart;
data = dataTable_.fnSettings().aoData[index].???;
}
[/code]

Sorry for my english. :)

Replies

  • izzy6150izzy6150 Posts: 49Questions: 0Answers: 0
    Hi there,

    I think what you might be looking for is something like: -
    [code]
    data = dataTable_.fnSettings().aoData[index]._aData;
    [/code]

    Regards,
    Izzy
  • allanallan Posts: 61,840Questions: 1Answers: 10,134 Site admin
    Hi manifest,

    Izzy is right on with _aData. aoData is really an internal object, to it might be subject to change in future (major) versions - although I've not needed to do that yet :-). As such, the place to find out how it is constructed is in the code:

    [code]
    /*
    * Variable: aoData
    * Purpose: Store data information
    * Scope: jQuery.dataTable.classSettings
    * Notes: This is an array of objects with the following parameters:
    * int: _iId - internal id for tracking
    * array: _aData - internal data - used for sorting / filtering etc
    * node: nTr - display node
    * array node: _anHidden - hidden TD nodes
    */
    this.aoData = [];
    [/code]
    All of the 'settings' object parameters are documented in the code like this as they can be most useful for API work.

    Regards,
    Allan
This discussion has been closed.