weavora/wform — Issue #14: jquery plugin: replace callbacks with events
Author: yurytolochko
Created: 2012-01-23 16:27:38+00:00
State: open

```javascript
$('.hasManyRelation')
.multiplyForms({
embedClass: 'has-many-item',
templateClass: 'just-empty-form-template-hasManyRelation'
})
.on('multiplyForms.add', function(event, embedForm, multiplyFormInstance){})
.on('multiplyForms.delete', function(event, embedForm, multiplyFormInstance){
event.preventDefault(); // callback-killer feature :)
if (confirm("Are you sure to delete this record?")) {
embedForm.hide().find('input[id$="valid"]').val(0);
}
});
```