Edit values and styles for the entire column

Edit values and styles for the entire column

fernandogferreirafernandogferreira Posts: 7Questions: 0Answers: 0
edited January 2010 in General
Hi,

I am using dataTables for display contents.
Everything works fine (great plug-in)

The only problem is: My site has an authefication system... If the user is logged in one column should change the value of all its rows...

I kind solved the problem using
[code]$("#col-id",document).each{ function(){
$(this).hmtl('New content');
$(this).css('background', 'transparent');
});

Sure this work only for the first page... Due the pagination, I can't change the entire table...

How can I do this

Thxs
}

Replies

  • pwc1011pwc1011 Posts: 62Questions: 0Answers: 0
    Hello fernandogferreira,

    You'll need to link your function to the redraw event, so each time after the table redraws it then run your function to change the formatting before display to the user.

    [code]
    $(document).ready( function() {
    $('#example').dataTable( {
    "fnDrawCallback": function() {
    $("#col-id",document).each{ function(){
    $(this).hmtl('New content');
    $(this).css('background', 'transparent');
    });;
    }
    } );
    } )
    [/code]

    Patrick
  • fernandogferreirafernandogferreira Posts: 7Questions: 0Answers: 0
    Thanks!
This discussion has been closed.