`
namespace Web_DSL.Enquiry {
@Serenity.Decorators.registerClass()
@Serenity.Decorators.responsive()
export class EnquiryDialog extends Serenity.EntityDialog<EnquiryRow, any> {
protected getFormKey() { return EnquiryForm.formKey; }
protected getIdProperty() { return EnquiryRow.idProperty; }
protected getLocalTextPrefix() { return EnquiryRow.localTextPrefix; }
protected getNameProperty() { return EnquiryRow.nameProperty; }
protected getService() { return EnquiryService.baseUrl; }
protected form = new EnquiryForm(this.idPrefix);
protected getToolbarButtons() {
let buttons = super.getToolbarButtons();
buttons.push({
title: 'Add Details',
cssClass: 'edit-permissions-button',
icon: 'icon-people text-blue',
**onClick: () => {
new EnquiryDetailsDialog({
//can i load EnquiryID with this EnquiryDetailsDialog..
EnquiryId =EnquiryRow.Fields.EnquiryId //enquiryid is primary key for Enquiry and forignkey for Enquirydetails
}).dialogOpen();**
}
});
buttons.push({
title: 'Attach Documents',
cssClass: 'edit-permissions-button',
icon: 'icon-people text-blue',
onClick: () => {
new EnquiryDocumentsDialog({
}).dialogOpen();
}
});
return buttons
}
protected updateInterface() {
super.updateInterface();
this.toolbar.findButton("edit-permissions-button").toggleClass("disabled", this.isNewOrDeleted());
//this.toolbar.findButton("undo-delete-button").detach();
}
}
}
`
Use
new EnquiryDetailsDialog().loadByIdAndOpenDialog(id)
or
new EnquiryDetailsDialog().loadEntityAndOpenDialog(entity)
Thank you so much for your response...it worked...
You're welcome :D
@Estrusco
@volkanceylan
as u suggested
i did following change
new EnquiryDetailsDialog().loadEntityAndOpenDialog(entity) //entity of parent form i.e enquiry
for the first time onclick of button above form is opened and data filled and i saved it.
for same click second time if data exits i want to load it ..is this possible..
please suggest way..
any help appreciated..
loadByIdAndOpenDialog as suggested.
Most helpful comment
Estrusco...
Thank you so much for your response...it worked...