8 Answers, 1 is accepted
0
Hello,
You can use the moveStart event and call e.preventDefault() to prevent a certain task from moving.
Regards,
Bozhidar
Telerik
You can use the moveStart event and call e.preventDefault() to prevent a certain task from moving.
Regards,
Bozhidar
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Shobhit
Top achievements
Rank 1
answered on 05 May 2015, 04:45 AM
Thank you very much.
Just one more question, similar to above, I need to make some of the tasks appear in the treelist view inside Gantt chart to be unsortable while others sortable.
0
Shobhit
Top achievements
Rank 1
answered on 05 May 2015, 05:00 AM
By unsortable I mean to say they can or cannot be reordered by dragging and droping
0
Hi,
Unfortunately there isn't an event that's triggered on this action yet, so implementing this will require some coding. Here's the code you need to add to your page in order to achieve this:
Regards,
Bozhidar
Telerik
Unfortunately there isn't an event that's triggered on this action yet, so implementing this will require some coding. Here's the code you need to add to your page in order to achieve this:
var
gantt = $(
"#gantt"
).data(
"kendoGantt"
);
var
selector =
".k-treelist .k-grid-content table td"
;
$(gantt.wrapper)
.on(
"mousedown"
, selector,
function
(e) {
if
($(
this
).parent().attr(
"data-level"
) ===
"2"
) {
// Prevent drag and drop of level 3 tasks (zero based indexing)
$(gantt.wrapper).on(
"mousemove.preventDrag"
, selector,
function
(e) {
e.stopPropagation();
})
}
})
.on(
"mouseup"
, selector,
function
() {
$(gantt.wrapper).off(
".preventDrag"
);
});
Regards,
Bozhidar
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Shobhit
Top achievements
Rank 1
answered on 05 May 2015, 07:11 AM
thank you so much,
One more thing, how to avoid dropping of rows with data-level="0" to become the child of data-level="0" or further, so that the items with level 0 will always remain the same.
0
Hello,
For this you can use the save event and check the corresponding fields.
Regards,
Bozhidar
Telerik
For this you can use the save event and check the corresponding fields.
Regards,
Bozhidar
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Shobhit
Top achievements
Rank 1
answered on 05 May 2015, 09:18 AM
Thank you so much for the help,
One last question, can we change the icon "+" "-" "cross" that appears during the dragging.
Also the logic based on which these icon change
0
Hello,
The Icon is changed based on the position of the task relative to the tasks underneath it. It's controlled by a class name, which changes between the following values, which are self-explanatory:
For instance the k-insert-top class is set to the icon when the task is to be added above another task.
To change the icon just use CSS and the above classes to set the background-image to your own icon.
Regards,
Bozhidar
Telerik
The Icon is changed based on the position of the task relative to the tasks underneath it. It's controlled by a class name, which changes between the following values, which are self-explanatory:
"k-insert-top",
"k-insert-bottom",
"k-add",
"k-insert-middle",
"k-denied",
For instance the k-insert-top class is set to the icon when the task is to be added above another task.
To change the icon just use CSS and the above classes to set the background-image to your own icon.
Regards,
Bozhidar
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!