serialize

serializes the component data into JSON, XML or CSV format

array|string serialize(string type,function callback);

Parameters

typestringoptional, the format that the data will be serialized into (json, csv, xml), json by default
callbackfunctionoptional, a function that will be applied to every item of the component

Returns

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

Example

// serialize data to an array of JSON objects
treegrid.data.serialize();
 
// serialize data to an XML string
treegrid.data.serialize("xml");
 
// serialize data to a CSV string
treegrid.data.serialize("csv");

Back to top