API Docs for: 0.0.2
Show:

dataSource.Record Class

Class representing a record in dataSource.Collection Instances of this class are created from getRecord When you update a record

Item Index

Properties

Methods

get

(
  • key
)
String | Number | Object

Return value of key

Parameters:

Returns:

String | Number | Object: value

set

(
  • key
  • value
)
dataSource.Record

Update property of record

Parameters:

Returns:

setProperties

(
  • properties
)
dataSource.Record | Undefined

Update multiple properties

Parameters:

Returns:

dataSource.Record | Undefined:

Example:

var collection = new ludo.dataSource.Collection({ idField:'id' }); collection.getRecord(100).setProperties({ country:'Norway', capital:'Oslo' }); will set country to "Norway" and capital to "Oslo" for record where "id" is equal to 100. If you're not sure that the record exists, you should use code like this:

var rec = collection.getRecord(100); if(rec)rec.setProperties({ country:'Norway', capital:'Oslo' });

Properties

eventKeys

Array

Array of events which should fire update event

Default: undefined