January 16, 2018, 11:36:59 AM

See more Support incidents in our old archived forum.

Author Topic: VW Grid and dropdown list columns  (Read 695 times)

steve.vilotti

  • Customers
  • Newbie
  • *
  • Posts: 5
VW Grid and dropdown list columns
« 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?

Rajagopal

  • RQ Members
  • Jr. Member
  • *
  • Posts: 92
Re: VW Grid and dropdown list columns
« Reply #1 on: June 22, 2016, 01:37:00 PM »
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,

Code: [Select]
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.
« Last Edit: June 23, 2016, 03:52:32 PM by Rajagopal »