mleibman / SlickGrid

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

Get getElementById on cells #879

Open ghost opened 10 years ago

ghost commented 10 years ago

I just started utilizing SlickGrid and am impressed with the functionality that I have been able to utilize with the product. I have been able to search the source and figure out and successfully implement everything I sought to accomplish thus far until this. I am looking at how to implement Google Maps autocomplete functionality into address fields on the grid. I have used this on several web products with great success on other projects. I believe that all that would be needed is to be able to getElementById or getElementsByClassName on the cell being edited and the usual code would work.

I did search for this and was unable to find an answer. Is there a way to get a particular cell using getElementById or getElementsByClassName?

Thanks

styfle commented 10 years ago

Take a look at the grid.getData method in the docs. There is no need (in fact it is strongly discouraged) to use DOM manipulation since the data in in a collection that can be fetched using the method above.

ghost commented 10 years ago

Not trying to get the data. getElementById is the usual means used with google.maps.places.Autocomplete to add a listener to an input, in this case the cell, and responds by filling a variable with an array of matching addresses. The cells don't have an id in the dom but when selected it can be located with document.getElementsByClassName('slick-cell l# r# cell-title active selected'). I'm still trying to figure out how to work with this, or another way.