getCellCombo v4.11 Pro -

When using this function I get the error:

Uncaught TypeError: undefined is not a function

	cbValue = gdDaily.cells(rId, 29).getValue();
	console.log(cbValue);
	cbReason = gdDaily.cells(rId,30).getCellCombo();
	cbReason.clearAll();
	cbReason.loadXML("./data/reason.php?r="+cbValue);

I need to populate another combo based on another combo.

Unfortunately you cannot get the value of the cell before it’s data loaded to the grid.
Please, make sure that the requested cell is loaded to the grid.

I sorted the issue

The function is called: getCustomCombo(rID, cID)

I loaded the grid from the database tables (PHP Connector Grid and Options).
I saved the state .save()
deleted the values that I did not need for the previous chosen option
Then restored the original state .restore()

My First Attempt looked like this manualy loading the combos (But Still Worked).

		gdDaily.attachEvent("onEditCell",function(stage, rId, cID, nValue, oValue){
			var cbValue = gdDaily.cells(rId, 29).getValue();
			console.log("cbValue = "+cbValue);
			var cbReason = gdDaily.getCustomCombo(rId,30);
			if (stage == 2 && cID == 29) {
				if(nValue != oValue) {
					cbReason.clear();
					cbReason.put(1," ");
					gdDaily.cells(rId, 30).setValue(" ")
				}
			}
			if (stage == 2) {
				switch(cbValue) {
					case "1": cbReason.clear();
							  cbReason.put(1," ");
							  break;
					case "2":	cbReason.clear();
							cbReason.put(1," ");
							cbReason.put(2,"Unsafe");
							cbReason.put(3,"Incorrect or no Key.");
							cbReason.put(4,"Incorrect or no OBASS.");
							cbReason.put(5,"Access not booked.");
							cbReason.put(6,"Access Refused");
							console.log("Size = "+cbReason.size());
							break;
					case "3":	cbReason.clear();
							cbReason.put(1," ");
							cbReason.put(7,"Arqiva permit incorrect.");
							cbReason.put(8,"Arqiva permit not raised.");
							cbReason.put(9,"Outage permit incorrect");
							cbReason.put(10,"Outage permit not raised");
							cbReason.put(11,"WIG permit incorrect");
							cbReason.put(12,"WIG permit not raised");
							cbReason.put(13,"Other");
							console.log("Size = "+cbReason.size());
							break;
					case "4":	cbReason.clear();
							cbReason.put(1," ");
							cbReason.put(14,"Unsafe to Climb.");
							cbReason.put(15,"Unable to complete BTS Work.");
							cbReason.put(16,"Unable to access Site.");					
							break;
					case "5":	cbReason.clear();
							cbReason.put(1," ");
							cbReason.put(17,"Sick.");
							cbReason.put(18,"Late.");
							cbReason.put(19,"Inadequately qualified.");
							break;
					case "6":	cbReason.clear();
							cbReason.put(1," ");
							cbReason.put(20,"Late addition to schedule.");
							cbReason.put(21,"No Transmission.");
							break;
					case "7":	cbReason.clear();
							cbReason.put(1," ");
							cbReason.put(22,"BTS consumables late delivery.");
							cbReason.put(23,"BTS consumables missing from delivery .");
							cbReason.put(24,"BTS consumables delivered but incorrect.");
							cbReason.put(25,"BTS hardware late delivery .");
							cbReason.put(26,"BTS hardware missing from delivery.");
							cbReason.put(27,"BTS hardware delivered but incorrect.");
							cbReason.put(28,"BTS hardware faulty.");
							cbReason.put(29,"Rigging consumables late delivery.");
							cbReason.put(30,"Rigging consumables missing from delivery.");
							cbReason.put(31,"Rigging consumables delivered but incorrect.");
							cbReason.put(32,"Rigging hardware late delivery.");
							cbReason.put(33,"Rigging hardware missing from delivery.");
							cbReason.put(34,"Rigging hardware delivered but incorrect.");
							cbReason.put(35,"Rigging hardware faulty.");
							cbReason.put(36,"Other.");		
							break;
				}
			}

			if (stage == 2 && cID == 27) {
				if (nValue == "1") {
					gdDaily.setRowColor(rId, "white");
				}
				if (nValue == "2" || nValue == "3" || nValue == "6") {
					gdDaily.setRowColor(rId, "red");
				}
				if (nValue == "5") {
					gdDaily.setRowColor(rId, "yellow");
				}
				if (nValue == "4") {
					gdDaily.setRowColor(rId, "green");
				}
			}
            if (stage == 2 && cID == 1) {
				if (nValue == 2) {
					window.dhx4.ajax.get("./data/mailAlert.php?id="+rId);
				}
			}			
            return true;
        });