RadiantQ Forum
Product => jQuery Gantt Package => Topic started by: steve.vilotti on June 22, 2016, 02:52:58 AM
-
I have a column that uses a dropdown when editing. Is it possible to set or change the items displayed in the dropdown list after the grid is loaded?
-
Steve,
Yes, it's possible to do that. We have already illustrated this in "Priority" column of "GanttControlTableCustomization" sample in our install.
EDIT:
Take a look at this "priorityEditor" in GanttControlTableCustomization sample,
RadiantQ.Binder.priorityEditor = function () {
this.init = function ($elem, role, value, data) {
var source = ["Low", "Medium", "High"];
for (var i = 0; i < source.length; i++) {
$elem.append("<option value=" + (i + 1) + ">" + source[i] + "</option>");
}
//To set the value to select.
$elem.val(value.getter(data));
//select change event.
$elem.change(function () {
//To update the boundobject.
data.Activity.DataSource.Status.Priority = $(this).val();
});
}
}
In this code, items for drop down is set in "var source = ["Low", "Medium", "High"];" code on "init" function of priorityEditor. You can customize something like this.
Thanks,
- Raja.