Bevor der Kunde am Datenmodell bearbeiten darf.
/*
since all objects are equal in here and minimum 1 object must be chosen
the easiest way here is to get all keys of the first object to get an array
of all attributes to be rendered
*/
var RenderProperties = _.keys( _objArr[0] );
Nachdem der Kunde am Datenmodell bearbeiten darf.
/*
since all objects are not equal anymore in here and minimum 1 object must be chosen
the easiest way here is to get all keys of all object to get an array
of all attributes to be rendered
*/
var RenderProperties = _.uniq(
_.flatten( _.map( _objArr, function ( _obj ) {
return _.keys( _obj )
} )
) );
Die Funktionen mit dem Unterstrich stammen von underscore.js