Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
javascript onclick disappears
posted

Hi

I am a beginner in Infragistics.

I have a WARP (WebAsyncRefreshPanel) and inside WARP there is a Ultrawebtab with two tabs Tab1 and Tab2.  In Tab1 it displays ASP.NET gridview with multiple records. One of the columns is a link in the gridview and onclick of that it switches or select the Tab2. The same column also calls a javascript to change the background color of the selected row in the gridview. But once the Tab2 is selected and after switching back to Tab1the link column does not call the javascript. I dont know what is the reason behind this.

Thank you,

Subash

Parents
No Data
Reply
  • 24497
    posted

    Hi Subash,

    Try to debug what happens with javascript by "alert" or "debugger". Replace a call to a function which changes background by
    alert('my function call');
    If it works, then restore call to your function, move that alert into implementation of function and remove the rest of logic from function. If it works, then there is problem in implementaion of your function. If alert does not appear, then probably function is not accessible. The reason for that can be usage or eval by ScriptManager of WARP (used to avoid memory leaks in IE). The work around for that situation is to make your function global explicitly (make it a member of window). Below is example.

    If your current implementation is
    function myFunction(a, b, c)
    {
       // implementation
    }

    then suggested implementaion is
    window.myFunction = function(a, b, c)
    {
       // implementation
    }
    or
    window["myFunction"] = function(a, b, c)
    {
       // implementation
    }
    You also may replace "alert(...)" by "debugger;", check flow of logic in more details and try to catch possible exceptions.

Children
No Data