BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
$("#GanttContainer").ejGantt({
"create": function (args) {
updateGanttHeight();
},
"collapsed": function (args) {
updateGanttHeight();
},
"expanded": function (args) {
updateGanttHeight();
},
"actionComplete": function (args) {
if (args.requestType == "save" || args.requestType == "delete") {
updateGanttHeight();
}
}
});
function updateGanttHeight() {
var ganttObj = $("#GanttContainer").ejGantt("instance"),
toolbar = $("#GanttContainer_toolbarItems").height(),
model = ganttObj.model,
treeObj = ganttObj._$treegridHelper.ejTreeGrid("instance");
totalLen = treeObj.getExpandedRecords(model.updatedRecords);
//To calculate the height of Gantt as per records count
var height = model.rowHeight * totalLen.length + treeObj.getHeaderContent().height() + toolbar + 20;
//Update height using setModel
var sizesettings = { height: height.toString() };
ganttObj.setModel({ "sizeSettings": sizesettings });
} |
$("#GanttContainer").ejGantt({
"splitterPosition": "782px",
"create": function (args) {
updateGanttHeight();
},
});
});
function updateGanttHeight() {
var ganttObj = $("#GanttContainer").ejGantt("instance"),
treegridWidth = 0,
model = ganttObj.model,
//To get the width of schedule header
scheduleWidth = $("#ganttviewerbodyContentejGanttChartGanttContainer").width(),
columns = model.columns;
//To get the width of TreeGrid section
for (var i = 0; i < columns.length; i++) {
if (columns[i].visible == true) {
treegridWidth = treegridWidth + columns[i].width;
}
}
treeObj = ganttObj._$treegridHelper.ejTreeGrid("instance");
totalLen = treeObj.getExpandedRecords(model.updatedRecords);
//To calculate the height and width of Gantt
var height = model.rowHeight * totalLen.length + treeObj.getHeaderContent().height() + 1,
width = scheduleWidth + treegridWidth + 15;
//Update size using setModel
var sizesettings = { height: height.toString(), width: width.toString() };
ganttObj.setModel({ "sizeSettings": sizesettings });
$("#ejTreeGridGanttContainere-gridcontent").removeClass("e-borderbox");
}
|