Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Quote:
Hi,

I am a new bie in Jquery...I want to have a progress bar such that the page will be in disabled mode till back end data is fetched. This is my code:

XML
<script type="text/javascript" src="Script/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="Script/jquery-ui-1.8.5.custom.min.js"></script>
    <script type="text/javascript" src="Script/json2.js"></script>
    <script src="Script/ShowProgress.js" type="text/javascript"></script>
    <link href="EDMCSS/Progress.css" rel="stylesheet" type="text/css" />


<script type="text/javascript">

$("#ddlwrkfltemplate").change(
    function() {
        var wkfltemplateid;
        debugger;
        $.showprogress();
        if ($("#ddlwrkfltemplate option:selected").text() == 'Select One') {
            $("#trpreswkflcreation").hide();
            $("#trHyperlnk").hide();
            $("#trlaststep").hide();
            $("#itrinitialstep").hide();
            $("#trbuttons").hide();
            $("#trdocflow").hide();
            wkfltemplateid = 0;
            $("#lstallpres").empty();
            $("#lstwkflpres").empty();
            $("#drpsteps").empty();
            $("#ddlwrkflnames").empty();
        }
        else {
            $("#trpreswkflcreation").show();
            $("#trHyperlnk").show();
            $("#itrinitialstep").show();
            $("#trlaststep").show();
            $("#trbuttons").show();
            $("#trdocflow").show();
            wkfltemplateid = "{wkflId:'" + $('#ddlwrkfltemplate').val() + "'}"
        }
        if (wkfltemplateid != 0) {
            var arr = { wkfl: { "WorkflowId": $('#ddlwrkfltemplate').val()} };
            var templateObj = "{wkflStr:'" + JSON.stringify(arr.wkfl) + "'}";
            $.ajax({
                type: "POST",
                url: "AsynchronousMethods.asmx/GetWorkflowtemplatedetails",
                data: templateObj,
                async: false,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function(data) {
                    $("#lblfrstStep").text(data.d.FirstStep);
                    $("#lbllastStep").text(data.d.CompletionStep);
                }
            });
            Workflow.PopulatePresList();
        }


    });


This is the part of html where i use a drop down list to populate certain details from background.
XML
<td align="left" runat="server" id="td1">
                                        <%--<asp:DropDownList ID="ddlwrkfltemplate" runat="server" Width="150px"></asp:DropDownList>--%>
                                        <select id ="ddlwrkfltemplate" runat="server" style="width:243px"/>
                                    </td>


But whenever i select some value from the drop down list...i get the above mentioned error in the line
$.showprogress();

I dont know what else should i inlcude to make this run. Please help me as soon as possible.
Posted
Comments
ZurdoDev 2-Apr-13 8:57am    
Where did you download showprogress.js from?
super_coder 2-Apr-13 9:03am    
hi..thnx for replying....i dont know where i got it...but i can show u its contents:

(function($) {
$.showprogress = function() {

$.hideprogress();
$("BODY").append('<div id="processing_overlay"></div>');
$("BODY").append(
'<div id="processing_container">' +
'<div id="processing_content">' +
'<table cellspacing="0" cellpadding="0" align="left" border="0" style="background-color: #E6E4D9">' +
' <tr>' +
' <td>' +
'
' +
' <table style="border-color: Red;" width="300px;">' +
' <tr style="width: 420px; background-color: #E6E4D9" valign="middle">' +
' <td style="padding-top: 3px; width: 300px" align="left" valign="middle" colspan="2">' +
' <table width="420px" style="background-color:White;">' +
' <tr align="center" valign="middle">' +
' <td>' +
' <img src="Images/info.gif" style="padding-left: 5px;">' +
' </td>' +
' <td>' +
' <p style="color:#AB8433;font-weight:bold;">Enterprise Document Management</p>' +
' </td>' +
' </tr>' +
' </table>' +
'</td>' +
'</tr>' +
'<tr>' +
' <td colspan="2">' +
' <img height="64" src="images/loading.gif" width="64">' +
' <br />' +
' <span style="color:#003399;">Retrieving information.<br>' +
' Please Wait a moment</span>' +
' <br />' +
' <img align="center" alt="" src="images/loading_9.gif">' +
' </td>' +
' </tr>' +
'</table>' +
'
' +
' </td>' +
' </tr>' +
' </table>' +
'</div>' +
'</div>');

var pos = ($.browser.msie && parseInt($.browser.version) <= 6) ? 'absolute' : 'fixed';

$("#processing_container").css({
background: 'Transparent',
position: pos,
zIndex: 99999,
padding: 0,
margin: 0,
border: 0
});

$("#processing_container").css({
minWidth: $("#processing_container").outerWidth(),
maxWidth: $("#processing_container").outerWidth()
});

var top = (($(window).height() / 2) - ($("#processing_container").outerHeight() / 2)) + (-75);
var left = (($(window).width() / 2) - ($("#processing_container").outerWidth() / 2)) + 0;
if (top < 0) top = 0;
if (left < 0) left = 0;

// IE6 fix
if ($.browser.msie && parseInt($.browser.version) <= 6) top = top + $(window).scrollTop();

$("#processing_container").css({
top: top + 'px',
left: left + 'px'
});
$("#processing_overlay").height($(document).height());
},
$.hideprogress = function() {
$("#processing_container").remove();
$("#processing_overlay").remove();
},
$.showmsg = function(msgEle, msgText, msgClass, msgIcon, msgHideIcon, autoHide) {
var tblMsg;

tblMsg = '<table width="100%" cellpadding="1" cellspacing="0" border="0" class="
ZurdoDev 2-Apr-13 9:04am    
I would put a breakpoint on $.showprogress() and then step into it. It sounds like it is some line within the showprogress function that is actually failing.
super_coder 2-Apr-13 9:08am    
I have already put a debugger ryan....but it is not going to the function itself. Error occurs while calling the function in jquery code.
ZurdoDev 2-Apr-13 9:15am    
Then your JS file is not getting loaded. If it can't step INTO the function, then the function isn't there which is why it is saying it can't find it on $. Are you sure that scripts/ShowProgress.js is the right path? Remove the text and re-type the first quotes " and use Visual Studio intellisense to pick the proper path. It may be that you need ../ or something in your path.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900