Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Àlex Corretgé on May 21, 2008 15:30
open dhtmlx forum
problems with getUserData

Hi, Today I upgrade the dhtmlxGrid prof and I have a problem:

getUserData don't retrieve info.

I have a function attached in OnEditCell Event (setOnEditCellHandler was eliminated)

            function myCalcGrup(rowId,col)
            {
                var regIds = (myCal.getSubItems(rowId)).split(',');
                var jUDLit = 'cap'+col;
                var cap = myCal.getUserData(rowId, jUDLit);
                alert(rowId + jUDLit + cap);
[...]

and a XML data like

<rows>
<row id="##RO-COMERCIAL">
<userdata name="cap4">999999999</userdata>
<userdata name="cap5">999999999</userdata>
<userdata name="cap6">999999999</userdata>
<userdata name="cap7">999999999</userdata>
<userdata name="cap8">999999999</userdata>
<userdata name="cap9">999999999</userdata>
<userdata name="cap10">0</userdata>
<userdata name="cap11">0</userdata>
[...]

with the alert I view that rowId is ##RO-COMERCIAL and jUDLit is cap4 but the variable cap is blanks.

Is there any change about the methode to retrieve userdata info?
Answer posted by Support on May 22, 2008 02:37
>>I have a function attached in OnEditCell Event (setOnEditCellHandler was eliminated)

Mentioned functionality was marked in dhtmlxgrid 1.5 as depricated ( actually it was deprecated starting from dhtmlxgrid 1.4 ) 

The same effect can be achieved with
mygrid.attachEvent("onEditCell" doOnCellEdit );

You can use correct syntax ( it will work for both dhtmlxgrid 1.5 and 1.6 ) or just include codebase/ext/dhtmlxgrid_deprecated.js to have full compatibility with older grid.

http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Migrating_to_16.html#grid_art_mig16


>> with the alert I view that rowId is ##RO-COMERCIAL and jUDLit is cap4 but the variable cap is blanks.
Please use attached patch , to restore correct userdata processing
Attachments (1)