jQuery UI Widgets › Forums › General Discussions › Layouts › Kanban › Kanban method "addItem"
This topic contains 4 replies, has 2 voices, and was last updated by dario 9 years, 3 months ago.
-
AuthorKanban method "addItem" Posts
-
Hi,
as I can set a value for the field “id” of a new item in a Kanban, using the “addItem” method?
Thank you.
DarioHi Dario,
Yo have to add “id” field in the object, used to create the new item.
If you don’t add such a field it’s set automatically.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comThanks for reply, ivallo.
I had thought the same thing, but it does not work.Here is the code:
$(‘#kanban’).jqxKanban(‘addItem’,
{
id : “IDvalue”,
status : “other values…”,
text : “other values…”,
tags : “other values…”,
color : “other values…”,
resourceId : number
});When I try to retrieve the id value I get the number set automatically by the control.
In fact the help of “addItem” method does not indicate “id” between the possible values.Where am I wrong?
Thanks in advance.Hi Dario,
Please, refer to this demo of kanban with “addItem” method.
Here is set the id without any problems.
If you don’t set the id, it will be set automatically.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comHi ivallo, thanks for reply.
I show you what is my problem, which manifests itself even in the code you posted.
Please add the event “itemAttrClicked” to the code, as shown below (and also rem the other console.log line, for clarity).
It shows the value of the id property of the clicked element.Well, clicking on the first item appears correctly “1161”.
After pressing “AddItem”, if you clicking on the new item, the “id” property returns an error.
But I would like it contained the new id immediately set.
I hope I was clear.$('#kanban').jqxKanban({ ... }) .on("itemAttrClicked", function (event) { console.log(JSON.stringify(event.args.item.id)); });Thanks in advance for your help.
Dario -
AuthorPosts
You must be logged in to reply to this topic.