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);
}
}
|
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!
|