YAHOO.widget.Record
addRecord
(
oObjectLiteral
,
index
)
Adds one Record to the RecordSet at the given index. If index is null,
then adds the Record to the end of the RecordSet.
- Parameters:
-
oObjectLiteral <Object>
An object literal of data.
-
index <Number>
(optional) Position index.
- Returns:
YAHOO.widget.Record
- A Record instance.
YAHOO.widget.Record
addRecords
(
data
,
index
)
Adds multiple Records to the RecordSet at the given index. If index is null,
then adds the Records to the end of the RecordSet.
- Parameters:
-
data <Object[]>
An array of object literal data.
-
index <Number>
(optional) Position index.
- Returns:
YAHOO.widget.Record
- An array of Record instances.
YAHOO.widget.Record || YAHOO.widget.Record[]
append
(
data
)
Convenience method to append the given data to the end of the RecordSet.
- Parameters:
-
data <Object || Object[]>
An object literal or array of data.
- Returns:
YAHOO.widget.Record || YAHOO.widget.Record[]
- A Record or array of Records.
void
deleteRecord
(
i
,
range
)
Removes the record at the given index from the RecordSet. If a range is
given, starts at the given index and removes all records in the range.
- Parameters:
-
i <Number>
Record index
-
range <Number>
(optional) Range of records to remove, or null.
- Returns:
void
Number
getLength
(
)
Returns the number of non-null records in the sparse RecordSet
- Returns:
Number
- Number records in the RecordSet
Object
getRecord
(
identifier
)
Returns record with given name, at the given index, or null.
- Parameters:
-
identifier <String || Number>
Record ID or record index
- Returns:
Object
- Record object
YAHOO.widget.Record || YAHOO.widget.Record[]
getRecordBy
(
sKey
,
oValue
)
Returns the record(2) with the given value at the given key.
- Parameters:
-
sKey <String>
Key to search.
-
oValue <Object>
to match against.
- Returns:
YAHOO.widget.Record || YAHOO.widget.Record[]
- Record or array of
Records with the given value at the given key, or null.
number
getRecordIndex
(
oRecord
)
Returns index for the given record.
- Parameters:
-
oRecord <object>
Record object
- Returns:
number
- index
Array
getRecords
(
i
,
range
)
Returns an array of Records from the RecordSet.
- Parameters:
-
i <number>
Index of which record to start at
-
range <number>
(optional) Number of records to get
- Returns:
Array
- Array of records starting at given index and lenth equal to
given range. If range is null, entire RecordSet array is returned.
YAHOO.widget.Record || YAHOO.widget.Record[]
insert
(
data
)
Convenience method to insert the given data into the beginning of the RecordSet.
- Parameters:
-
data <Object || Object[]>
An object literal or array of data.
- Returns:
YAHOO.widget.Record || YAHOO.widget.Record[]
- A Record or array of Records.
YAHOO.widget.Record || YAHOO.widget.Record[]
replace
(
data
)
Replaces all Records in RecordSet with new data.
- Parameters:
-
data <Object || Object[]>
An object literal or array or data.
- Returns:
YAHOO.widget.Record || YAHOO.widget.Record[]
- A Record or array of Records.
void
reset
(
)
Removes all Records from the RecordSet.
Array
sort
(
fnSort
)
Sorts RecordSet by given function.
- Parameters:
-
fnSort <Function>
Reference to a sort function.
- Returns:
Array
- Sorted array of Records
string
toString
(
)
Public accessor to the unique name of the RecordSet instance.
- Returns:
string
- Unique name of the RecordSet instance
void
updateRecord
(
oRecord
,
sKey
,
oData
)
Updates given Record at given key with given data.
- Parameters:
-
oRecord <YAHOO.widget.Record>
A Record instance.
-
sKey <String>
Key.
-
oData <object>
{Object) New data.
- Returns:
void