Unable to handle custom data format in DHX List item


#1

Hi DHX Team,
I’m trying to populate a list item with custom XML data format, and am getting the following error:

Uncaught TypeError: Cannot read property ‘jsarray’ of undefined.

The property “jsarray” is a part of the recommended code snippet in the dhtmlx list example for loading custom data, and is reproduced below:

dhtmlx.dataDriver.my_jsarray=dhtmlx.extend(
dhtmlx.extend({},dhtmlx.dataDriver.jsarray),{
getDetails:function(data){
var result = {};
result.id_client = data[0];
result.login = data[1];
result.password = data[2];
result.type = data[3];
result.account_state = data[4];
result.type2 = data[5];
result.id_currency = data[6];
result.full_name = data[7];
return result;
}
});

The required error snapshots along with the code and the custom xml file is attached for your review. Do tell me how to resolve this issue.

Thanking you in advance.

Regards
Manish Kumar Deshpande
DHX Error Code.zip (290 KB)


#2

Hi,

Please try to change

dhtmlx.dataDriver

to

dhtmlx.DataDriver

#3

Thanks for the quick reply. I’ll do the needful and revert back. This code was used as per the online application example.


#4

Hi Stanislav,
I tried the suggestion given by you and the result is still an error as there is some issue with the line#9 in dhtmlx.js as the “toObject” is undefined. Please see the screenshot attached, and also the code below:

Kindly help out. Thanks in advance.

Regards
Manish.



#5

Check the attached sample

  • you are using XML data, so jsarray will not help
  • custom xml pattern can be assigned to work with such dataset
    xml-custom-list.zip (19.8 KB)

#6

Thanks very much, it’s just working fine.