Skip to content

Instantly share code, notes, and snippets.

@avasyukov
Last active December 22, 2015 02:08
Show Gist options
  • Save avasyukov/6401215 to your computer and use it in GitHub Desktop.
Save avasyukov/6401215 to your computer and use it in GitHub Desktop.
// Create the list of available users and push it into model
// UI control will be created automatically
var userConstraint = [];
// Loop through managees and add them all to constraint
for each( user in managees )
{
// 'Label' is what user will see in user interface, 'value' is what will be passed to report script
userConstraint.push( { "label": user.firstName + ' ' + user.lastName, "value": user.userName } );
}
// UI config is stored here
model.meta = [];
// Create new control, set field name in 'field', control type in 'type' and available values in 'values'
model.meta.push( { "field": "user", "type": "select", "values": userConstraint } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment