Uncaught TypeError: Cannot read property 'replace' of undefined

I have in my code a basic Kanban with “comments: true” and I’m populating the kanban from a php file that outputs the following xml:

CNF James 1 James@mail.com [{id:1, date:2019-01-28 18:33:05, text:Is it ready}] [{id:1, date:2019-01-28 18:33:05, text:Is it ready}, {id:2, date:2019-01-28 18:33:19, text:Not yet}]

The kanban is populated with the above data and comments icon shows 2 comments, but when I click on it, the comment widget opens with no comments and the console shows the following error:

Uncaught TypeError: Cannot read property ‘replace’ of undefined

What am I doing wrong? Also is it a problem that comments id:1 is showing twice?
Thanks,
Brian

It seems that you are mixing JSON and XML data
With such a code, the kanban will read comments data as string instead of objects, and as result will not be able to get any further properties.

The default format of data for kanban is the JSON

You can use XML, but it means that all values inside of data must be encoded as XML.

Thanks Maksim,

I’ve tried encoding as xml as follows:




and still get the same error message. Do you have a example of the correct xml format?’
Thanks,
Brian

Please check this
https://docs.webix.com/datatable__supported_data_types.html

Hi Nastja,

I am following the xml schema properly and can load the kanban with xml, but the problem is trying to add comments with xml.

Do you have an xml example that includes comments tag or can provide some guidance for including comments?

Thanks,
Brian

Could you please clarify why do you use xml instead of JSON?
JSON is easier to implement

Please, try the following snippet: https://snippet.webix.com/8v6af0xk

The trick does the stack property as an attribute of a comments tag, which indicates an array of comment items:

<comments stack="1"><item text="try it"/></comments>

Perfect. Thank you Helga!

Nastja, just my preference.

Thank you all for the assistance!