I found manual on how to attach grid to form in docs section. However I can’t get it working.
Below is my code.
[code]var id = “window_” + (new Date()).getTime();
dhxWindow = dhxLayout.dhxWins.createWindow(id, 100, 100,800,600);
dhxWindow.setModal(true);
dhxWindow.setText(“New customer”);
dhxWindow.center();
var formStruct = [
{type:“settings”, position: “label-left”, labelWidth: 100, inputWidth: 220},
{type: “block”, inputWidth: 370, offsetTop: 12, list: [
{type:“input”,name:‘nameComp’,label:‘Company:’, required: true},
{type:“input”,name:‘phone’, label:‘Phone’,},
{type:“input”,name:‘email’,label:‘E-mail’,validate:‘ValidEmail’},
{type: “container”,name:“employees”,label: “Employees”,inputWidth: 600,inputHeight: 200, position: “label-left”},
{type: “button”, name:“addNE”, value:“New employee”}
]}
]
var dhxWinTbar = dhxWindow.attachToolbar();
dhxWinTbar.addButton(‘save’,0,‘Save’);
dhxWinTbar.addButton(‘cancel’,1,‘Cancel’);
dhxWinTbar.attachEvent(‘onClick’, function(id) {
switch(id) {
case “save”:
posGrid.submitOnlyChanged(false);
// posGrid.parentFormOnSubmit();
dhxForm.send(“save.php”,“post”,function(response) {
console.info(response);
});
break;
}
});
var dhxForm = dhxWindow.attachForm(formStruct);
posGrid = new dhtmlXGridObject(dhxForm.getContainer(“employees”));
posGrid.setHeader(“First name, Last name, Phone, E-mail”);
posGrid.init();
dhxForm.attachEvent('onButtonClick', function(id){
switch(id) {
case "addNE":
posGrid.addRow('newRow[' + i + ']','');
break;
}
});
[/code]
When I press the save button I get:
[code]TypeError: posGrid.submitOnlyChanged is not a function
posGrid.submitOnlyChanged(false);
[/code]
I use version downloaded today from your site. It’s 4.6 full standard suite.
I received the same error with parentFormOnSubmit