I'm trying to trigger a second event dependent on the first like so:
...
$('#productFamilyId').val(data.contents.productfamily);
$('#productFamilyId').trigger('change', function() {
$('#productId').val(data.contents.product);
$('#productId').trigger('change');
});
It's not waiting for the first trigger to complete before attempting to trigger the second event. Is it possible to wait for the first trigger to complete?