Page 1 of 1

Save&Close combined button in a designer sugestion

Posted: Tue Jan 19, 2016 11:38 pm
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 1157 times

Re: Save&Close combined button in a designer sugestion

Posted: Wed Jan 20, 2016 1:25 pm
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.

Re: Save&Close combined button in a designer sugestion

Posted: Wed Jan 20, 2016 7:58 pm
by FrenkR
works perfectly, thank you.

Re: Save&Close combined button in a designer sugestion

Posted: Thu Jan 21, 2016 6:37 am
by Andrew
Hello,

Glad to help you!

Have a nice day.