Add custom combobox to Wavemaker

Asked By 0 points N/A Posted on -
qa-featured

Dear Friends,

Can anyone, please help me by telling me the step by step process of, how to manage and add custom combobox to Wavemaker on the dialog.

Thanks,

Anna W Brown

SHARE
Answered By 0 points N/A #198791

Add custom combobox to Wavemaker

qa-featured

Well if you have an editable grid, and your editable column needs a ComboBox as an editor, follow this method:

 

  •   You need to add these two parameters to add a ComboBox:

 

Field name: Name of Grid’s field

Options: Array of strings as options for the ComboBox

 

  •   Method to set up a column:

As an example to add a ComboBox to a grid of employees to specify their manager, assuming that manager is a related table:

var data = this.managerLiveVariable.getData();

var options = [];

for (var i = 0; i < data.length; i++)

   options.push(data[i].firstname + " " + data[i].lastname);

this.dojoGrid1.setColumnComboBoxOptions("manager", options);

 

To map this display value back to the original data value:

getManagerIdByName: function(inName) {
var data = this.managerLiveVariable.getData();
for (var i = 0; i < data.length; i++) {
   if (data[i].firstname + " " + data[i].lastname == inName) {
       return data[i].managerid;
   }
   return 0;
}
dojoGrid1CellEditted: function(inSender, inValue, inRowIndex, inFieldName) {
   var rowData = this.dojoGrid1.getRow(inRowIndex);
   if (inFieldName == "manager") {
       var managerId = this.getManagerIdByName(inValue);
       this.writeUserVar.sourceData.setData({
              "userid": rowData.userid,
              "manager": {"managerid": managerId}});
       this.writeUserVar.update();
   }
}

 

Related Questions