I try to refresh a kanban with the result of an ajax query.
My kanban is composed of 2 columns, and each column has several items (representing persons) :
Name on the top, and role on the bottom part of the item.
I have a form to add a new person (Name and role).
An ajax query save the new person in the database and the response is the new list of persons (including the new one).
This list is a json.
I set this json to the localData of my kanban source.
As there is no refresh function, I remove all kanban’s items and then add the new items list one by one with the addItem function :
It works fine except for the new person I added. The role is displayed in the item, but instead of having is name, “no name” is displayed.
I think it’s a mapping problem because when I refresh my page, the kanban is well displayed.
In my new json list, i have these properties :
classname, color, content, id, identity, libelle, name, resourceId, status, tags and text
When i refresh my page :
color, id, identity, libelle and status
Do you have any idea? when we change the kanban localdata, do we have to set again a mapping ? how ?
Thx a lot for your help. It’s the last bug of my application !!!!!
This topic was modified 6 years, 8 months ago by admin.
When you are adding a new row you need to include the field that points to the corresponding resourceSource localdata row ( in the above example, “resourceId” property in Source.localData contains the id of the corresponding resourceSource.localData row). If you want the newly added row to contain new data you also need to add a new line to the resourceSource.localdata with the new info about the new record. Also the Json that you are passing to the sources.localdata must contain valid fields, that are defined in the “fields” array.