Hi,
I used the grid and form bind the data in datastore. But it cannot use the button in form that bind the data from the grid. please help.
myLayout2 = myLayout.cells(“c”).attachLayout({
parent: document.body,
pattern: “2E”,
skin: “dhx_web”,
cells: [
{id: “a”, text: “Departments”},
{id: “b”, text: “Create New Department”}
]
});
myGrid = myLayout2.cells("a").attachGrid();
myGrid.setImagePath("dht/codebase/imgs/");
myGrid.loadXML("xml/createDeptGrid.xml");
myForm2 = myLayout2.cells("b").attachForm();
myForm2.loadStruct("json/createDeptForm.json");
mygrid.bind([b]"myform2"[/b], function(data,master){
if (master.deptName == "") return true;
return mygrid.cells(data, 1).getValue().toLowerCase().indexOf(master.Name)!=-1;
});
createDeptGrid.xml
<?xml version="1.0" encoding="UTF-8"?> Dept ID Department Name<row id="1">
<cell>1</cell>
<cell>Administrative Dept</cell>
</row>
<row id="2">
<cell>2</cell>
<cell>Finance Dept</cell>
</row>
<row id="3">
<cell>3</cell>
<cell>I.T Dept</cell>
</row>
<row id="4">
<cell>4</cell>
<cell>Logistic Dept</cell>
</row>
<row id="5">
<cell>5</cell>
<cell>Merchandising Dept</cell>
</row>
<row id="6">
<cell>6</cell>
<cell>Sales Dept</cell>
</row>
createDeptForm.json
[
{type: “settings”, position: “label-left”, labelWidth: 700, inputWidth: 200},
{type: “fieldset”, label: “Create Department Form”, inputWidth: 340, list:[
{type: "input", label: "Create New Department"},
{type: "button", value: "Proceed"}
]}
]