Serenity: How to remove extra buttons from dialog

Created on 15 Dec 2017  路  5Comments  路  Source: serenity-is/Serenity

I am opening BugComment dialog in Bug module. Module opens but it adds extra buttons of undo, localisation, clone and delete which is unnecessary. Extra button is coming when I open it into another module, it work fine with same module. I have tried to find that button using class and tried to remove them but when I remove/hide/disable button on edit in another module it effect the edit dialog.

1
2
3
4

And may I know how to add dialogue title
I used to find class ui-dialog-title and added text to this class. Is there any another way to add dialog title

Most helpful comment

I have followed #1286 but still facing the same issue. Actually, I have dialog over another dialog.
Code snippet I have added is super.updateInterface();. For more you can check below code
protected afterLoadEntity() { super.afterLoadEntity(); super.updateInterface(); }

All 5 comments

See here https://github.com/volkanceylan/Serenity/issues/1286

and search for getToolbarButtons in samples.

Also see https://github.com/volkanceylan/Serenity/issues/1889 for title

I have followed #1286 but still facing the same issue. Actually, I have dialog over another dialog.
Code snippet I have added is super.updateInterface();. For more you can check below code
protected afterLoadEntity() { super.afterLoadEntity(); super.updateInterface(); }

Use

protected getToolbarButtons(): Serenity.ToolButton[] {
    var b = super.getToolbarButtons();

    b.splice(Q.indexOf(b, x => x.cssClass == "delete-button"), 1);
    b.splice(Q.indexOf(b, x => x.cssClass == "undo-delete-button"), 1);
    b.splice(Q.indexOf(b, x => x.cssClass == "localization-button"), 1);
    b.splice(Q.indexOf(b, x => x.cssClass == "clone-button"), 1);

    return b;
}

buttons.push({ title: Q.text('Comments'), cssClass: 'comment-button', icon: 'icon-speech text-blue', onClick: () => { var dlg = new CommentUserDialog(); this.initDialog(dlg); dlg.loadEntityAndOpenDialog(<CommentUserRow>{ UserID: 1, // your value secondField: value }); } });

The way I had implemented opendialog was incorrect. When I have followed the above code I am seeing the actual dialog.
Thanks
You can close the ticket.

Hi @Itsathere

you can Close the ticket yourself :-)

With Kind regards,

John

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Akarsh03 picture Akarsh03  路  3Comments

ga5tan picture ga5tan  路  3Comments

AmuthaKondusamy picture AmuthaKondusamy  路  3Comments

ahsansolution picture ahsansolution  路  3Comments

stepankurdylo picture stepankurdylo  路  3Comments