Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Lonnie on Aug 07, 2007 16:46
open dhtmlx forum
dhtmlxGrid and Rails Applications (specifically Prototype.js)

Forgive me for asking this a third time, but no response has been given for the prior to requests.

I have ran into difficulties in using the latest update to dhtmlXGrid Pro (1.4) with Rails applications when there is a radio button (type="ra") in the grid.  I can reproduce the error by taking one of the supplied sample grids and including the prototype, effects, dragdrop and controls javascripts that are core to any Rails application.  The error returned seems to be triggered by the javascript for/in statements over the rowsAr array within the forEachRow function.  If I am using a grid with 2 rows and I echo out the this.rowsAr.length I get the proper number of rows, however the for/in statement sets the counter a to 0, 1 and then the string 'each'.

I have found references on the internet as to how the Prototype library overrides basic Javascript objects (in this case Arrays), but the arguments were split as to whether Prototype broke anything or whether people are using the for/in statement incorrectly.  To get around this I have modified the for/in statement to be of the for (init; expression; increment) style.  I only did this for the one function that my grids were utilizing, however I did notice that there are other for/in statements within the libraries and I am concerned about other features not working.  Will there be a patch for this or is it the developer's opinion that the problem is truly within the Prototype libraries?
Answer posted by radyno (Support) on Dec 09, 2014 02:10

Having solved the problem mentioned above, you may also look through the possible related problems with excell and download javascript.