Zrobiłem grida oraz formularz dhtmlx w technologii asp net mvc. Wszystko działa tzn. wyświetla mi dane oraz formularz. Jednak, postępując zgodnie z dokumentacją dhmlx, napisałem kod w js, który powinien powodować ładowanie do formularza wartości z zaznaczonego wiersza w gridzie.
Jednak w przeglądarce dostaje error: bind is not a function, i za licho nie wiem dlaczego?
Kod html:
<div id="grid_here" style="width:600px; height:400px;">
</div>
<div id="myform_container" style="width:350px;height:160px;"></div>
Kod js:
var grid = new dhtmlXGridObject("grid_here");
grid.setImagePath("/javascripts/codebase/imgs/");
grid.setHeader("Name, Last name, Pesel, Phone,Address");
grid.setInitWidths("100,160,*");
grid.setSkin("dhx_skyblue");
grid.setColumnIds("Name,LastName,Pesel,Phone,Address");
grid.init();
grid.load("/Default/Data?=" + grid.uid());
formData = [
{
type: "fieldset", offsetTop: 0, label: "Edit Form", width: 253, list: [
{
type: "input", name: "Name", label: "Name", offsetTop: 13,
labelWidth: 60
},
{
type: "input", name: "LastName", label: "LastName", offsetTop: 7,
labelWidth: 60
},
{
type: "input", name: "Pesel", label: "Pesel", offsetTop: 7,
labelWidth: 60
},
{
type: "input", name: "Phone", label: "Phone", offsetTop: 7,
labelWidth: 60
},
{
type: "input", name: "Address", label: "Address", offsetTop: 7,
labelWidth: 60
},
{ type: "button", name: "save", value: "Submit", offsetTop: 18 }
]
}
];
var myForm = new dhtmlXForm("myform_container", formData);
myForm.bind(grid);