hi,
input the form data, the same data can display automatically in the grid, but the attachFooter disappear automatically.
following instruction :
the grid has footer
add form->input data->save data->the grid show this data automatically(the footer disappear)
please help.
[code]var dhxGrid;
dhxLayout = new dhtmlXLayoutObject("parentId", "2u");
dhxLayout.cells("a").hideHeader();
dhxLayout.cells("a").setWidth(180);
dhxLayout.cells("b").hideHeader();
dhxGrid = dhxLayout.cells("b").attachGrid();
dhxGrid.setImagePath("dht/grid/codebase/imgs/");
dhxGrid.setSkin("dhx_skyblue");
//dhxGrid.setHeader("Username,Accident Date,Reason");
dhxGrid.setColumnIds("username,accidentdate,reason");
//dhxGrid.setHeader("Column A, Column B, Column C, Column D");
dhxGrid.init();
dhxGrid.dataFeed("lib/get_taf.php");
dhxGrid.load("lib/get_taf.php");
id='nr_q'>0</div>,,#cspan", ["text-align:left;"]);
dhxGrid.attachFooter("<input type='button' name='export' id='export' value='Add' onclick='taf_add_wins()'>,,#cspan,#cspan,#cspan,#cspan,#cspan");
function taf_add_wins(){
var winForm,formData;
dhtmlx.skin = “dhx_skyblue”;
window.dhx_globalImgPath = “dht/combo/codebase/imgs/”;
formData = [{
type: "settings",
position: "label-left",
labelWidth: 100,
inputWidth: 120
}, {
type: "combo",
label: "Name",
name: "username",
connector : "lib/get_username.php",
//readonly: true,
value: ""
}, {
type: "calendar",
dateFormat: "%d-%m-%Y ",
name: "accidentdate",
label: "Date From",
readonly: true,
validate: "NotEmpty",
calendarPosition: "right"
},{
type: "input",
label: "Reason",
name: "reason",
value: "交通意外事故,導致塞車"
}, {
type: "button",
value: "Save",
name: "SEND"
}];
dhxWins = new dhtmlXWindows();
dhxWins.enableAutoViewport(false);
dhxWins.attachViewportTo("parentId");
dhxWins.setImagePath("dht/xWindows/codebase/imgs/");
w1 = dhxWins.createWindow("w1", 200, 30, 400, 350);
w1.setText("Traffic Accident Form");
winForm = w1.attachForm(formData);
winForm.attachEvent("onButtonClick", function(id) {
if (id == "SEND"){
dhxGrid.bind(winForm);
dhxGrid.load("lib/get_taf.php");
winForm.save();
dhxGrid.bind(winForm);
dhxWins.window("w1").close();
}
winForm.bind(dhxGrid);
});
var dp = new dataProcessor("taf_connector(form).php");
dp.init(winForm);
}
[/code]