Login Register

dynamic options for dojox.grid.editors.select

I've tried a few different way to dynamically populate the options for dojox.grid.editors.select control in a grid. The closest I've come was to build a html string of dijit.form.ComboBox and return it from a cells "get:" function. Any suggestions?

{ name: "Mediator", width: 14, field: 9, styles: 'text-align: right;', get: getMediators }		

function getMediators(rowIndex)
{
	var mediators = this.grid.model.data[rowIndex][this.fieldIndex];
	if (mediators.length == 0)
		return "";
	else if (mediators.length == 1)
		return mediators[0].name
	else
	{
		var options = "value='"+mediators[0].name+"' ";
		dojo.forEach(mediators, function(m) {
				options += ""+m.name+"";
		});
		return '";
}