function on server side generated table

function on server side generated table

cmoozcmooz Posts: 21Questions: 0Answers: 0
edited April 2009 in General
hi,
i want to use this http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery

in my server side generated table but it does only work outside the table

code is okay, what can i do to get this running?

Replies

  • allanallan Posts: 61,451Questions: 1Answers: 10,055 Site admin
    Hi cmooz,

    Have a look at this thread: http://datatables.net/forums/comments.php?DiscussionID=187 . There are a number of other links in that thread which might be useful.

    Allan
  • cmoozcmooz Posts: 21Questions: 0Answers: 0
    i solved it while adding another fnDrawCallback

    now it looks like this:

    "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
    var $cell=$('td:eq(3)', nRow);
    $cell.text(ellipsis($cell.text(),25));
    return nRow;

    },

    "fnDrawCallback": fnOpenClose,
    "fnDrawCallback": fnShowPic,

    but the openclose is not working any more, when i change order of openclose & showpic always that one which is standing in last line works, the other not

    any idea?
  • allanallan Posts: 61,451Questions: 1Answers: 10,055 Site admin
    Well you can't have two properties called the same thing ;-)

    How about something like:

    "fnDrawCallback": function (a,b,c) {
    fnOpenClose(a,b,c);
    fnShowPic(a,b,c);
    }

    Allan
  • cmoozcmooz Posts: 21Questions: 0Answers: 0
    well,

    "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
    var $cell=$('td:eq(3)', nRow);
    $cell.text(ellipsis($cell.text(),25));
    return nRow;
    fnShowPic( nRow, aData, iDisplayIndex );
    fnOpenClose( nRow, aData, iDisplayIndex );
    },

    does not work... nothing happens

    i tried to add this to my image for opening the details table



    it seems to work but i do have to click 3times for first opening and 2 time for closing and opening again

    any idea to solve this problem?

    thanks
  • allanallan Posts: 61,451Questions: 1Answers: 10,055 Site admin
    You've got unreachable code!

    The fnShowPic() and fnOpenClose() functions aren't ever going to run there because there is a return statement in front of them! Try putting the return statement at the end of the function :-)

    Allan
This discussion has been closed.