How can I define the row-ID for CSV/jsArray? From your examples it seems that the row-ID should be the first element in a csv-string or js array. These values are allocated in the ‘data0’ property but not used as property in the pull object as it is done for JSON and XML data.
Please, how can I accomplish a user-defined row-id if csv or jsarray data types are read? Of course with a transformation script, but perhaps there is a simpler approach already implemented in webix?
p.s. Currently I accomplish this by following snippet:
webix.DataDriver.jsarray.getDetails=function(data){
var result = {};
for (var i=0; i < data.length; i++)
result["data"+i]=data[i];
result["id"]=data[0]; // map first value as row-id
return result;
}
As csv and js-array can contain any data, component does not try to use any field as the ID, instead of it, component will auto-generate ids for each row.
The above code is fine, but you can define a new type of data parser instead of patching the existing one. http://webix.com/snippet/26fb4008
We will add idColumn property to both jsarray and csv parsers in the next build.