// subform field fill calculation object Zymonic.FieldFillCalculation.SubForm = function() {}; // do the inheritance Zymonic.FieldFillCalculation.SubForm.prototype = new Zymonic.FieldFillCalculation.FieldFillCalculation(); Zymonic.FieldFillCalculation.SubForm.prototype.constructor = this; //binds all handlers needed to trigger this field fill Zymonic.FieldFillCalculation.SubForm.prototype.bindHandlers = function() { // call super to set the handlers Zymonic.FieldFillCalculation.FieldFillCalculation.prototype.bindHandlers.call(this); // if there is a form, add handlers to recalculate handlers if any records on that form change var form = this.getForm(); if (form) { // catch record changed event on that form to redo handlers // as changed records may have changed fields var self = this; form.onRecordsChange( function(event, form, extras) { self.bindHandlers.call(self); if (extras && extras.recalculation_needed && self.parent_field) { self.parent_field.getValue(); } }, "subform_ffc_records_changed_handlers_"+this.ident ); } }; //gets all the dependent field idents on this field fill Zymonic.FieldFillCalculation.SubForm.prototype.getDependentFields = function() { var dependent_fields_list = Zymonic.FieldFillCalculation.FieldFillCalculation.prototype.getDependentFields.call(this); var dependent_fields = {}; for (var i=0; i