serialize

serializes the component data into JSON, XML or CSV format

array|string serialize(string type);

Parameters

typestringoptional, the format that the data will be serialized into (json, csv, xml), json by default

Returns

array|stringserialized data for each item of the component either as an array of JSON objects or as a CSV/XML string

Example

var data = component.data.serialize("csv");

Related samples

Back to top