Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145842 | Jul 10,2019 11:42 AM UTC | Jul 12,2019 03:49 AM UTC | jQuery | 1 |
![]() |
Tags: ejGantt |
$("#gantt").ejGantt({
//...
actionBegin: function (args) {
if (args.requestType == "openEditDialog") {
var ganttObj = $("#gantt").ejGantt("instance");
var obj = $("#treegrid" + ganttObj._id + "resourceEdit").ejTreeGrid("instance");
obj.model.beginEdit = function (args) {
var columns = this.model.columns;
var resources = [
{ resourceId: 1, resourceName: "Project Manager" },
{ resourceId: 2, resourceName: "Software Analyst" },
]; // New resource collection
var dropDownData = columns[0].dropdownData = $.extend(true, [], resources);
var dataSource = this.model.dataSource;
var value = args.data.item.name;
for (var i = 0; i < dataSource.length; i++) {
if (value != dataSource[i].name) {
var index = $.map(dropDownData, function (data, index) {
if (data["resourceId"].toString() == dataSource[i].name) {
return index;
}
});
dropDownData.splice(index[0], 1);
}
}
if (dropDownData.length <= 1) {
ganttObj.enbleDisableAddResourceButton('disable', "beginEdit");
}
}
}
},
}); |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.