Save&Close combined button in a designer sugestion

Stimulsoft Reports.WEB discussion
Post Reply
FrenkR
Posts: 131
Joined: Mon Jan 05, 2015 12:15 am

Save&Close combined button in a designer sugestion

Post by FrenkR »

can you please evaluate option to add additional (optioned) button "Save&Close" the same way as "Save" button is. When clicking this button, system should ask user to save changes(Yes/No dialog) and then execute standard "exit" event(same way as File->Exit does).

Button should be added near "Save button" as proposed in a following picture:
ssSaveExit.png
ssSaveExit.png (25.01 KiB) Viewed 1153 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Save&Close combined button in a designer sugestion

Post by HighAley »

Hello, Frenk.

You could use next code to add a button.

Code: Select all

<body>
    <form id="form1" runat="server">
        <div>
            <cc2:StiMobileDesigner ID="StiMobileDesigner1" runat="server" />
        </div>
    </form>
    <script type="text/javascript">
        var saveAndExitButton = jsStiMobileDesigner1.StandartSmallButton("saveAndExitButton", null, null, "Save.png", null);
        saveAndExitButton.style.margin = "0 5px 0 5px";

        //if you want override button image, use this code
        //saveAndExitButton.image.src = "https://www.stimulsoft.com/favicon.png";
                
        saveAndExitButton.action = function () {
            jsStiMobileDesigner1.SendCommandSaveReport();
            jsStiMobileDesigner1.SendCommandExitDesigner();
        }

        var toolBarTable = jsStiMobileDesigner1.options.toolBar.firstChild;
        var saveAndExitCell = toolBarTable.rows[0].insertCell(1);
        saveAndExitCell.appendChild(saveAndExitButton);
    </script>
    
</body>
Thank you.
FrenkR
Posts: 131
Joined: Mon Jan 05, 2015 12:15 am

Re: Save&Close combined button in a designer sugestion

Post by FrenkR »

works perfectly, thank you.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Save&Close combined button in a designer sugestion

Post by Andrew »

Hello,

Glad to help you!

Have a nice day.
Post Reply