I am trying to bind data to a form from a grid and nothing happens (grid is working fine)
this is the code:
var base_layout = new dhtmlXLayoutObject(document.body, ‘4I’);
var cellInfo = ‘a’;
var cellHotel = ‘b’;
var cellForm = ‘c’;
var cellTab = ‘d’;
base_layout.cells(cellInfo).setHeight(‘100’);
base_layout.cells(cellInfo).setText(‘Event’);
base_layout.cells(cellHotel).setText(‘Hotels’);
base_layout.cells(cellForm).setText(‘Hotel Information’);
base_layout.cells(cellTab).setText(‘Room Information’);
var defcombo = {
parent: “listEvent”,
label: “select event”,
width: 200,
readonly: true
}
var cmbEvent = new dhtmlXCombo(defcombo);
cmbEvent.loadXML(“handler/GetEventList.ashx”);
cmbEvent.attachEvent(“onSelectionChange”, onSelectionChangeFunc);
base_layout.cells(cellInfo).attachObject(“comboEvent”);
cmbEvent.attachEvent(“onXLE”, onComboLoaded);
function onComboLoaded() {
cmbEvent.selectOption(0, false, true);
document.getElementById(‘comboEvent’).style.display = “block”;
}
function onSelectionChangeFunc() {
if (cmbEvent.getSelectedValue() == ‘’) { return; }
base_layout.cells(cellHotel).progressOn();
// grid.clearAll();
// grid.loadXML(“handler/GetEventHotelList.ashx?eventid=” + cmbEvent.getSelectedValue());
}
var str = [
{ type: “input”, name: “NAME”, label: “Name”, validate: “NotEmpty”, maxLength: 100, inputWidth: 100 },
{ type: “input”, name: “NICKNAME”, label: “Nickname”, maxLength: 100, validate: “NotEmpty”, inputWidth: 100 }
];
var formhotel = base_layout.cells(cellForm).attachForm(str);
var grid = base_layout.cells(cellHotel).attachGrid();
grid.selMultiRows = false;
grid.enableMultiselect(false);
grid.enableMultiline(true);
grid.setHeader(“Nickname,Name,From,To,Official”);
grid.setInitWidths(“100,200,50,50,50”);
grid.setColAlign(“left,left,center,center,center”);
grid.setColumnIds(“NICKNAME, NAME,FROM,TO,OFFICIAL”);
grid.setColTypes(“txt,txt,dhxCalendar,dhxCalendar,ch”);
grid.setColSorting(“str,str,date,date,na”);
grid.dragAndDrop = “false”;
grid.setEditable(false);
grid.init();
formhotel.bind(grid);