Page 1 of 1

Feature request for Asp.net (ClientSideEvents)

Posted: Fri Dec 06, 2013 6:04 pm
by Haraldf
Hi,

we have a feature request for ClientSideEvents for the ASP.Net stuff:

We want to add a HTML5 based "Save As" dialog to our page. We need
some "hock" to get the event from the designer.

Code: Select all

@Html.Stimulsoft().StiMvcDesigner(new StiMvcDesignerOptions()
{
    ActionSaveReportTemplate = "SaveReportTemplate",
    ActionSaveReportTemplateAs = "SaveReportTemplateAs",
/* ... */
    ClientSideEvents.SaveReportTemplateAs = "function() { SaveReportTemplateAs(); return false; /* false -> omit default action */ }";
})

<script type="text/javascript">
    function SaveReportTemplateAs() {
        if(!DialogTellsOKToSave())
             return;
        var url = '@Url.Action("SaveReportTemplateAs", "Home" )';
        $.ajax({
            url: url,
            cache: false,
            success: function (data) {
                // ...
            },
            error: function (jqXHR, textStatus) {
                // ...
            }
        });
    }
</script>

Re: Feature request for Asp.net (ClientSideEvents)

Posted: Tue Dec 10, 2013 7:26 am
by Vladimir
Hello,

Perhaps the following solution will be good for you. Please set the following options:

Code: Select all

SaveReportTemplateMode = StiMvcDesignerOptions.SaveMode.Visible,
SaveReportTemplateAsMode = StiMvcDesignerOptions.SaveMode.Visible
In this case, saving will occur in POST request (instead of AJAX), and you can return the View with custom save form of the report.

Thank you.

Re: Feature request for Asp.net (ClientSideEvents)

Posted: Tue Dec 10, 2013 2:37 pm
by Haraldf
Hello Vladimir,

unfortunatly this is not an option.

The Viewer/Designer is called via ajax. (Re)Posting the page would destroy the state
of the rest of the page.

Please check the images I posted you. The Viwer/Designer runs in a dynamically loaded <div>

Re: Feature request for Asp.net (ClientSideEvents)

Posted: Wed Dec 11, 2013 1:02 pm
by Vladimir
Hello,

Unfortunately, currently there is no such possibility. When you save the report, occurs AJAX or POST request to the server.

Thank you.