tags:

views:

28

answers:

2

I have a DataTable in YUI and I want to have the record ID be from my data instead of yui-rec1 ...

How do I do that?

A: 

I think you can use

dataTAble.getRecord method

YAHOO.widget.Record getRecord ( row )

For the given identifier, returns the associated Record instance.
Parameters:
row <HTMLElement | Number | String> DOM reference to a TR element (or child of a TR element), RecordSet position index, or Record ID.
Returns: YAHOO.widget.Record
Record instance.

http://developer.yahoo.com/yui/docs/YAHOO.widget.DataTable.html

Or you need something else?

dmitko
Looking to `set`, not `get`
Kristopher Ives
+1  A: 

It is a private property called _sId which store record id. It follows this pattern

this._sId = "yui-rec" + this._nCount;

Sorry but recordSet API does not allow you to modify record id.

Arthur Ronald F D Garcia
Not the news I wanted, but an excellent answer either way.
Kristopher Ives
@Kristopher Ives Thank you. If you want, see here: http://jsbin.com/ideha a nice application whose datatable instances allows you to select a single and multiple rows at the same time.
Arthur Ronald F D Garcia