Hi All,
What javascript would I use to delete a specific group within a repeat group from some other condition within a form?
For example, I have a multi-select element (dropdown) where the selected options could change within a record (rowID). I want my repeat group to reflect the options selected in the multi-select element. If an option is selected, I am able to create a group using:
Great!
But, if a previously selected option is unselected (a group had been previously added and still exists), I need for the script to compare what is selected vs the groups that exist and where a specific group needs to be removed, I need the javascript function that can do that.
Is there an equivalent to duplicateGroup(), that is called deleteGroup()? I think there is, but I need to know which parameters I need to include to target a specific group. I can't find the scripts that run when the delete icon is clicked to mimic that action.
I am able to compare my list of groups and selected items to know which group needs to be deleted, but I don't know how to delete it!
Thanks
What javascript would I use to delete a specific group within a repeat group from some other condition within a form?
For example, I have a multi-select element (dropdown) where the selected options could change within a record (rowID). I want my repeat group to reflect the options selected in the multi-select element. If an option is selected, I am able to create a group using:
JavaScript:
var form = Fabrik.getBlock('form_' + formRef);
var btn = form.form.getElement('#group' + groupId + ' .addGroup');
if (typeOf(btn) !== 'null') {
var e = new Event.Mock(btn, 'click');
form.duplicateGroup(e);
}
Great!
But, if a previously selected option is unselected (a group had been previously added and still exists), I need for the script to compare what is selected vs the groups that exist and where a specific group needs to be removed, I need the javascript function that can do that.
Is there an equivalent to duplicateGroup(), that is called deleteGroup()? I think there is, but I need to know which parameters I need to include to target a specific group. I can't find the scripts that run when the delete icon is clicked to mimic that action.
I am able to compare my list of groups and selected items to know which group needs to be deleted, but I don't know how to delete it!
Thanks