Weird Problem, Needing some help

Weird Problem, Needing some help

UPEngineerUPEngineer Posts: 93Questions: 0Answers: 1
edited November 2010 in General
Hello,

I have got a weird problem and am needing some guidance.

I have a table that displays 3 columns of info. The first column is the green/red icons to hide/show the details of the row.

All of this is pulled server side.

I have used the example given to show/hide details and it works great (or so I thought).

Evidently, IE6 does not attach a click event (live or otherwise) to the td img, at least it doesn't appear to. I have tried every iteration I could think of with no luck.

On a whim, I changed it to a element and changed my code and it works in IE6. But my problem is how do I close the details records once opened? I thought of toggle but I don't know enough about jquery to get it done. The examples uses the icon name to basically do this.

Any help or does anyone know a workaround to get IE6 to natively see the click on the TD img??

Thanks,
Scott

Replies

  • UPEngineerUPEngineer Posts: 93Questions: 0Answers: 1
    edited November 2010
    Well after hours of extensive testing, I have found that for whatever reason, IE6 will not attach a click event to an image such as used in the show/hide details example. I even used live/livequery with no luck.

    I could not try the example because it would not load in IE.

    Here is a workaround I finally came up with and it seems to work, but I am not sure if it is the best approach or what kind of performance hit it will make.

    I had to wrap the in a span and assign it a class. I used classname of test as you can see.
    Here is the code:

    [code]

    "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
    $('.test', nRow).live('click', function() {
    var nTr = this.parentNode.parentNode;
    if($(this).find("img").attr("src") == "assets/images/details_close.png")
    {
    /* This row is already open - close it */
    $(this).find("img").attr("src", "assets/images/details_open.png");
    oTable.fnClose( nTr );
    }
    else
    {
    /* Open this row */
    $(this).find("img").attr("src", "assets/images/details_close.png");
    oTable.fnOpen( nTr, fnFormatDetails(nTr), 'details' );
    }
    });
    return nRow;
    }
    [/code]

    As you can see I used the fnRowCallback function to accomplish this.

    Any better ways of doing it?

    Thanks,

    Scott
This discussion has been closed.