Hi.
Since there are at least some scripts that need more robust data input in their configuration, it would be great to be able to receive 'maps' of data from the user. These could be introduced in a special type of dialog.
- I think a new type of control would be needed for this, similar to a
Data Grid
. Unlike the currentListview
in details mode, this allows editing all cells instead of just those in one column. This new control would also be extremely useful in other scripts, where edit is needed in a cell based control. - The declaration of a map variable in
OnInit()
could be as follows:
var map = DOpus.Create().Map();
map('header')= DOpus.Create().Vector('name','col1','col2','col3'); //declaration of column headers
map('aaa')= DOpus.Create().Vector('aaa','bb','cc','dd'); //a default value as example
initData.config['my_map'] = map;
The dialog for user input would look something like this:
Within the script, reading the values from the map would be something like this:
var map = Script.config['my_map'];
for (var e = new Enumerator(map); !e.atEnd(); e.moveNext()) {
item = e.item();
DOpus.Output(item + ' => ' + map(item)('col1') + '\t' + map(item)('col2')+ '\t' + map(item)('col3')); // 'name' value should be the same as item
}
It would simplify the introduction of more complex data, and it would also avoid any errors in reading that can currently occur when trying to find workarounds to read this type of data.
I hope you got my point and think it's a good idea!
Thanks!