[GH-DEV#2230] Problem with enabling and disabling cells after comparing them

Tags: #<Tag:0x00007f51b98d3ad0> #<Tag:0x00007f51b98d33c8>

Hello, good morning,
Could you help me with an editing problem I cannot solve?

When I compare two cells in the row,
I validate the information that the cells have and return a numeric value to validate whether a cell is greater than another and thus tell it to block or enable it. This requires that when a person has already edited, they no longer edit until the other edits for the second time.

https://jsfiddle.net/nexter_me/ytc50w6x/28/

Hi @guillermo.050526

I would use afterChange hook to specify if the new value entered to a cell is already in another cell. Here https://handsontable.com/blog/expand-your-app-with-cell-dependencies you can read more about the cell dependencies and how to use hooks.

If you’d need anything more than that please let me know.

Hello, good morning.
I’m telling you that it doesn’t work for me because when I create the handsontable I need to block the cell if the value is greater. I’m sharing the code with you because when I put the block in the cell it puts it in another cell.

cells: function (row, col) {
var cp = {};

           if (col === 1) {
               const etvs = JSON.stringify(
                this.instance.getDataAtRowProp(row, 1)
                                 ); 
                                 const mds = JSON.stringify(
                this.instance.getDataAtRowProp(row, 2)
                                 ); 
              
                             
              let [etv, md] = Resutlados(etvs,mds);
              
             // console.log(etv + " || " + md +"  \n");
              
               if ( Number(md) == Number(etv) ) {
                  cp.readOnly = false;
                   cp.editor = "text";
                   
               }else if (Number(md) > Number(etv) ) {
                cp.readOnly = false;
                cp.editor = "text";
                
               } else if (Number(etv)  > Number(md) ) {
                cp.readOnly = true;
                cp.editor = null;
                
              
               } 
              
            }
              return cp;
          }

https://jsfiddle.net/nexter_me/ytc50w6x/28/

Please check if rewriting the code to use array of objects instead of array of arrays would solve the issue. We have recently found an issues related to use of AoA and skipping/reordering columns in columns settings.

Hello, good morning.

So that is the problem. I am looking for another method in js to process the information. I am trying the renders. I hope that it works. Anyway, thanks for the support.

If that was a problem I will update you as soon as we fix the issue. That should happen for v15.3.0 (planned release end of April). If anything changes I will let you know.