Welcome Guest Search | Active Topics | Sign In | Register

Progressbar crash in jQuery dialog Options
Philipp Jenni
Posted: Friday, June 15, 2012 4:23:07 AM
Rank: Advanced Member
Groups: Member

Joined: 6/9/2007
Posts: 98
Hi,

I would use a progressbar in a jquery dialog. The progressbar raised an javascript error.

Here is an example Page:

Code: HTML/ASPX
<script src="scripts/jquery-1.7.2.js"></script>
    <script src="scripts/jquery-ui-1.8.20.min.js"></script>
    <script language="javascript" type="text/javascript">

        $(document).ready(function () {
            initDialog();

            $("#<%=this.bAbort.ClientID %>").click(function (e) {
                e.preventDefault();
                eo_GetObject('pgImport').stopTask();
                $("#<% = progressdialog.ClientID %>").dialog("close");
            });


            $("#<%=this.bImport.ClientID %>").click(function (e) {
                e.preventDefault();
                $("#<% =progressdialog.ClientID %>").show();
                $("#<% =progressdialog.ClientID %>").dialog("open");
            });

        });

        function initDialog() {
            $("#<% = progressdialog.ClientID %>").dialog({
                height: 400,
                width: 250,
                modal: true,
                position: 'center',
                autoOpen: false,
                title: 'Import...',
                open: function (event, ui) { eo_GetObject('pgImport').startTask(); }
            });
            $("#<% = progressdialog.ClientID %>").parent().appendTo($("form:first"));
        }
    </script>
    <asp:Button ID="bImport" runat="server" Text="Import" />
    <div id="progressdialog" runat="server">
        <div>
            <eo:progressbar runat="server" id="pgImport" controlskinid="Windows_Vista" minimum="0"
                maximum="100" onruntask="pgImport_RunTask" />
            <asp:button id="bAbort" runat="server" text="Abort" />
        </div>
    </div>



Code: C#
protected void pgImport_RunTask(object sender, EO.Web.ProgressTaskEventArgs e)
        {
            for (int i = 0; i < 100; i++)
            {
                //Check whether the task has been stopped
                if (e.IsStopped)
                    break;

                //Perform some work
                System.Threading.Thread.Sleep(1000);

                //Update client side progress
                e.UpdateProgress(i, null);
            }
        }


eo_support
Posted: Friday, June 15, 2012 1:30:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

This appears to be a JQuery issue. For some reason it removed one of the DHTML element the ProgressBar rendered when it initializes the dialog. This element is invisible but it is needed for our ProgressBar to function. We do not know whether this is just a JQuery bug, or JQuery has deeper reasons to do that. So we would like to wait and see for now. In theory JQuery should not touch anything inside the dialog.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.