How to get div Id when Click on a Cell

Tags: #<Tag:0x00007f0b0e88a818>

Hi, In My Example, I am getting div Id and HandsonTable Configuration from Backend through API in Json Format.

One API is For getting Handsontable div id and Buttons. another API is getting Table Configuration.

while Validating the cell hot is considered as last rendered handsontable . in My case i am using Multiple Handsontables and configuration Dynamically. So i am not maintain hot1 and hot2 separately.

how to validate each Cell based on validation . or else is there any possibility to get the Handsontable div id while click on a particular cell.

Here my JS fiddle Example is there: https://jsfiddle.net/kranthi2210/tpcasbqz/

Hey @kranthikumar.reddy32

or else is there any possibility to get the Handsontable div id while click on a particular cell.

The only thing you need is the this.container reference. I’ve added it to your demo at line 40 https://jsfiddle.net/2kj3zsqw/

Hi aleksandra, It is not working if I Enter value is 15 in First table column2 validation false i am getting. because Validation values are capturing from last render table. I am given Min value is 15 and Max value 100 for First Table Column2 but is it is captured min value is 1000 and max value is 10000.

And also same as first Table column3 , iam given min value is 10 and max value is 100, but it is captured min is 1 and max values is 10 from table 2 column3.

while validating the cells validation values are not captured for that particular table. capturing From last rendered Handson table.

so i am asking is there any possiblity to get Handsontable div id while click on cell, based on that i will generate hot . and validate cell while click on cell. please Check line nuumber 90 in my Example https://jsfiddle.net/kranthi2210/tpcasbqz/

or else how to validate Dynamic Table cells Validations.

To confirm @kranthikumar.reddy32, you want te Handsontable DIV id to print instead of the value in line 90, yes?

No, In my example Validations are consider for Table 1 also from Last Rendered Handsontable validations. If i get the div id while click on a cell , In aftrselection hook i redefine hot from div id to get the exact validations for each and every table like mentioned below.

but as you mentioned above this.container returns last rendered table details only when i click on first table also.

var $container= $(’#’+ divid);
var hot = $container.handsontable(‘getInstance’);

or else please suggest how to validate dynamic table cells.

Aleksandra Any Update on this.

Sorry for keeping you waiting, @kranthikumar.reddy32

I asked my colleague to take a took at your ticket and we both think that there’s some missing details in your use case. We would really want to help. But at this point, we need to ask you some more questions to understand the use case.

Would you be able to share a draft of the information flow between the parts of your application? At the moment, we understand that you have multiple Handsontable instances in your project and you want to logically connect two of them ad validate all of the cells in both of the grid when one of the cells in any of those two grids is selected.

I need to validate both tables , in table 1 i am given some validation for each cell and same as for second table also.

when i enter a value in first table in any cell in After Selection hook and in validation part all validation are considered from second table. but i am entering values in first table cell. because second table is rendered last.

but my requirement is based on cell selection and table wise validate the fields.

I’m still not sure about the expected outcome. What would you say for a call on Wednesday, @kranthikumar.reddy32? You could show us what you are working on and the scenario that needs attention. If so, please contact me at support@handsontable.com, and we’ll share the details.