lcollong
FabriKant d'applications web
Hi,
For in invoicing system, one can choose the price list (depends on country / Currency) and build the invoice adding product from the right PL with the right prices (repeat group).
The PL is selected from a DBJoin rendered as a dropdown in the main list.
The goal is to let the user choose/change the PL as far as there are not yet repeated group records. But once it start to build his invoice adding repeated groups, he can no longer change his choice in the PL dropdown. Not allowed to mix products from different PL.
The idea is to catch the duplicate/delete group to toggle the state of the dd.
hence :
It works but I loose the value of the PL choice on submit.
1/
Sometime ago, you added a pseudo readonly method to the regular dropdown to allow such. I don't think it is available for the DBJoin one. Right ? Is there better way to achieve this ? Would it be possible to add such for the DBJoin elt ?
2/ the fabrik.form.group.duplicate.end event works well for all groups added after the first one. But when there is no record at all, the "plus sign" is on the table header and seems to be associated with another event that I need to catch in order to disable the main PL Dropdown as soon as the first group is created.
Thanks.
For in invoicing system, one can choose the price list (depends on country / Currency) and build the invoice adding product from the right PL with the right prices (repeat group).
The PL is selected from a DBJoin rendered as a dropdown in the main list.
The goal is to let the user choose/change the PL as far as there are not yet repeated group records. But once it start to build his invoice adding repeated groups, he can no longer change his choice in the PL dropdown. Not allowed to mix products from different PL.
The idea is to catch the duplicate/delete group to toggle the state of the dd.
hence :
JavaScript:
requirejs(['fab/fabrik'], function () {
var elt = 'devis___dev_type_catalogue';
Fabrik.addEvent('fabrik.form.group.delete.end', function(form, event, groupId, repeatCounter){
//console.log('delete');
if (repeatCounter == 0) {
form.formElements.get(elt).element.disabled = false;
}
});
Fabrik.addEvent('fabrik.form.group.duplicate.end', function(form, event, groupId, repeatCounter){
//console.log('add');
var selectCatalogue = form.formElements.get(elt);
//console.log(selectCatalogue);
selectCatalogue.element.disabled = true;
});
});
It works but I loose the value of the PL choice on submit.
1/
Sometime ago, you added a pseudo readonly method to the regular dropdown to allow such. I don't think it is available for the DBJoin one. Right ? Is there better way to achieve this ? Would it be possible to add such for the DBJoin elt ?
2/ the fabrik.form.group.duplicate.end event works well for all groups added after the first one. But when there is no record at all, the "plus sign" is on the table header and seems to be associated with another event that I need to catch in order to disable the main PL Dropdown as soon as the first group is created.
Thanks.