RadiantQ Forum
Product => jQuery Gantt Package => Topic started by: dniezgoda on August 04, 2021, 08:15:04 AM
-
Hi Team,
Is there any way to enter/exit edit mode from code behind for specific column cell?
eg. Enter edit mode for Name column right after adding new row to the gantt
Thank you in advance!
-
Hi dniezgoda,
Provide the unique cell class name to the column that you want to edit programmatically,
{
field: "Activity_M().ActivityName_M()",
title: "Activity Name",
width: 150,
cellClass: "nameCol",
editor: RadiantQ.Default.Template.ProjectGanttExpandableTextboxEditor(),
template: RadiantQ.Default.Template.ProjectGanttExpandableTextBlockTemplate()
}
And then get that specific column from the newly added activity view to make the cell into edit mode.
$("#addRow").click(function () {
var newTask = getNewTask();
ganttControl.AddNewItem(newTask);
setTimeout(function () {
var actView = ganttControl.ActivityViews[ganttControl.ActivityViews.length - 1];
ganttControl.$ganttWrapper.data("GanttRowselectable").selectedItems.clear();
// Select the row before start editing
ganttControl.AddSelectedItem(actView);
var $tr = ganttControl.grid.GetRowFromData(actView)
var $td = $("td.nameCol", $tr);
// To edit the cell
ganttControl.grid.editCell($td);
}, 100);
});
Thanks
Raja
-
it works like a charm!
Thanks a lot for your quick support.
-
one more thing, could you pls help me to commit a editing cell (Name column) from code behind?
For example:
When user create a new task and naming it but not hit Enter key to commit change instead he press a shotcut key to run another action.
In this case, the editing text cannot be commited to name column
-
Hi, We are looking on this, will update you soon.
Thanks,
Raja
-
We sent you the updated sample to your email. Please check and confirm it.