I have a grid and a form.
The form shows the detail if the selected row in grid.
The form should change once the selected row changes.
I use the form.loadStruct(“info.php”+"?rowId="+id), but the form didn’t clear the former one.
So when I changed selecting rows form several times, the info in the form will show all these info.
If I use the form.foreachitem method, the error will alert can’t get _list value.
Thanks!
Hi
form.loadStruct load structure for form, seems like you need to load data.
for this you can use form.setFormData()/getFormData()
Andrei, thank you for ur reply.
The suggested setFormData() is a good useful method which I have not noticed. But in my situation, not all the detail are provided in the grid, and the form displays different templates due to the different types of the grid row. So I pass an id to the form initialization.
Currently, I use form.unload() and new dhtmlxform() every time I wanna refresh, instead of new instance at the begining for only once. It really works, at the compromise of every time newing and attaching events to the form.