Hi,
I’ve got myself in a muddle trying to add a dropdown select slot to a table, and have the selection submitted back through the model in the utility hook when a ‘Tutor Transfer’ button is clicked for that row. I likely need to go back to basics on how BF data models work, but here’s what I have if anyone can point me in the right direction?
HTML:
"slots": [{
"html": "<div class=\" pull-right flex items-center\">\n \n\n <div class=\"relative text-left pull-right\">\n <div>\n <button @click.stop=\"namedAction('transferAction', {groupSelect: row.tutorUnitGroup})\" class=\"btn-pri\">Tutor Transfer</button>\n\n </div>\n\n </div>\n</div>",
"slot": "icons"
}, {
"html": "<div>\n <select class=\"form-select block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50\">\n <option disabled selected>{{ model.unitAllocs[0].tutorUnitGroup }}</option>\n <option v-for=\"group in _.uniq(model.unitAllocs.map(group => group.tutorUnitGroup))\" :key=\"group\" :value=\"group\">{{ group }}</option>\n </select>\n</div>\n",
"slot": "tutorUnitGroup"
}],
transferAction script:
{
"action": "runUtilityHook",
"options": {
"item": "groupSelect",
"type": "save"
}
}
I’m assuming I need a function that writes the selection back to the model, but my attempts have hit a wall so far and there may be a more straightforward approach I’m unaware of?
Also, the Group options are currently being generated from unique options in the current model, which is an unnecessary complication - this is just for dev purposes and will ultimately come from an additional array in the model instead.
Many thanks