Change text color after edit a cell

Change text color after edit a cell

valdezrvaldezr Posts: 49Questions: 0Answers: 0
edited December 2009 in General
I am using jeditable plugin to edit a text in a cell.
I tried the next code in the callback function:

"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
aData = oTable.fnGetData(aPos[0]);
aData.addClass('blueded');
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
}


but it is not working
How can acomplish this task to change the text color to identify an edited cell.

Thanks in advance for your support.

Replies

  • valdezrvaldezr Posts: 49Questions: 0Answers: 0
    I also tried

    [code]
    var aPos = oTable.fnGetPosition( self );
    var aData = oTable.fnSettings().aoData[ aPos[0] ]._aData;
    aData.addClass('blueded');
    [/code]

    with no result
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    edited December 2009
    Hi valdezr,

    Discussion ID 1000! I feel like there should be a prize or something... How about an answer to your question :-) :

    It looks like you are trying to add a class so an Array - and using a function (addClass) which doesn't exist for an array (it's a jQuery function).

    Try something like this:

    [code]
    "callback": function( sValue, y ) {
    var aPos = oTable.fnGetPosition( this );
    aData = oTable.fnGetData(aPos[0]);
    aData.addClass('blueded');
    oTable.fnUpdate( sValue, aPos[0], aPos[1] );

    $(this).addClass('blueded');
    }
    [/code]
    Regards,
    Allan
This discussion has been closed.