A grid in one cell of the layout sync-ed to the datastore
A form in another cell with binding to the grid.
It’s all working well except for one thing. When the page is 1st displayed no row in the grid is selected and the form fields are blank. (If a row on the grid is manually selected it displays the correct data.)
How do I either:
a. Force the grid to select the first row? Tried mygrid.selectRow(0) but that doesn’t seem to do anything.
b. Hide the form until a grid row is selected. Can hide items on the form but not the form itself.
a. Force the grid to select the first row? Tried mygrid.selectRow(0) but that doesn’t seem to do anything.
Please, make sure that the you are selecting the row after the data is loaded to the grid.
You may use the onXLE event or a callback function of the load() method:
In my case I have the grid and the form in separate cells in a layout. Layout views can be used to hide/show the form as required…
…
myform.bind(mygrid);
mylayout.cells(“b”).showView(“blank”); // “blank” can be any other content or nothing
// Here, “blank” is not defined so cell shows nothing
// Now show the form in the cell if a row in the grid is selected
mygrid.attachEvent(“onRowSelect”, function(id){
mylayout.cells(“b”).showView(“def”);
// “def” view is default view set up when form was attached to layout cell earlier
});
DHTMLX 4 is an excellent suite of software. The more I find out the more impressed I am.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan