How do I change cells, based on a user editing a different cell?

How do I change cells, based on a user editing a different cell?

bigsipperbigsipper Posts: 31Questions: 2Answers: 0

Having a hard time wrapping my brain around how to do this:

User changes a 'color' value from 'red' to 'brown'.

I want to locate all other rows in the table that have column 'color' == 'red',
and change them to 'brown'.

I'm using jeditable, and can detect when the user changes the cell.... but then what?
How do I loop through all the other rows, detect those that have the same color, change
the data, and have the table redrawn to show the udpates.

the callback:

      $( "td.color", oTable.fnGetNodes()).editable( 
         function(value,settings){ 
            return(value); 
         },
         { 
            "callback": function( sValue, y ) { 
               var aPos = oTable.fnGetPosition( this ); 
               var currentValue = oTable.fnGetData( this ); 
               if ( aPos ){
                  if ( currentValue != sValue ){  
                     oTable.fnUpdate( sValue, aPos[0], aPos[2] ); 
                     // search out all items in table with the same tag, and update their color too...
                     // ?
                  }
               } 
            }, 
            "placeholder":' ',
         }
      );

Plz send a clue.

This discussion has been closed.