mleibman / SlickGrid

A lightning fast JavaScript grid/spreadsheet
http://wiki.github.com/mleibman/SlickGrid
MIT License
6.82k stars 1.98k forks source link

Valid and change all data of row #1080

Open carles9000 opened 9 years ago

carles9000 commented 9 years ago

Hi masters,

What is the best way to enter a value and after changing the contents of other columns ?. Example: I write in the column 1 "Ben" and after validate this value, i want the column 4 shows "Hello Ben!"

Thanks on advance !

Carlos

zoechi commented 9 years ago

http://stackoverflow.com/questions/new/slickgrid is probably a better place for such a question.

6pac commented 9 years ago

It's true that GitHub issues are for bug reports. In this case, it's a short answer - use your formatter writing skills to retrieve the value from the same row but different column.

carles9000 commented 9 years ago

Günter I did not know that this forum was only for bugs, sorry, my mistake

Ben if I have a grid with 3 columns with name, col-1, col-2, col-3 and I write a formatter for the col-1 as an example, do not change the values after edit col-1. You know that I can do wrong?

function My_Formatter( row, cell, value, columnDef, dataContext ){  

       if ( value == '1' ) { 
                 dataContext[ 'col-2' ] = 'Value 1';
       } else {
                 dataContext[ 'col-2' ] = '';
       }
      return value;
 }

Finally thanks for your help and maybe i can see in other site :-), I'm sory....

Carles.

6pac commented 9 years ago

Formatting on the same cell is updated after editing the cell. To reformat other cells in the row you probably need to call grid.invalidateRow and grid.render after editing. Unfortunately there is no cell after edit event, so you'd probably have to put that in a custom editor.

carles9000 commented 9 years ago

Ben,

Thanks for your comments. I see that solution will be in custom editor. A little bit complex for me, but i'll try. Many thanks for your guide and suport.

Carles.