I am using the a screen layout which shows a grid in one of the cell. The grid has an on double click event which opens a window.
This window has 12 tabs. Each tab has a dhtmlxform. There are around 650 data elements and form fields.
So I need advice on the fastest and best way to make this work. Here’s what I am thinking:
First:
When the screen is first accessed, after the all the cells in the layout have loaded, I call a windowInit() function to prepare the window for use. This function defines the window, attaches the tabs, attach the forms, create an empty data store, bind the forms to the data store and create all of the event handlers.
Is there a way to define the window/tabs/forms/event handlers without needed to actually show the window?
Second:
When the user double clicks on the row, the data store will ajax the 650 elements and setCursor(). Next the window will merely open because it has already been defined.
Third:
When the user closes the window, this should really be a hind() and then clear the forms.
Fourth
When the user clicks on the data row in grid, follow the same outline as the 2nd step. I realize it may not be necessary to make the data store ajax the data if it already has it.
Does this sounds like a good plan? Any recommendations?
So you’re saying to create the window when the page loads, then hide it.
Yes, you don’t need to create it many times - just hide and show it.
Then each time the user clicks on the row in the grid, open the window and build the tabs.
Window will be SHOWed, not opend, tabs will be already built (when the window was built)
This seems like the tabs will be built a lot of times. Is there a way to only build the tabs/forms just one time?
You can load all the forms at first window.show()
Will using a View make this more efficient / faster / better?
It is difficult to me to invent how to apply the view mode on your app - haven’t anough info about it.
I create the window add the 1C layout, tabs and forms and then hide() it. Then click on the grid and show() it. The window is blank.
Next I tried using a View. So… create window, create 1C layout view, tabs forms and then hide(). Then click on the grid, show() the window, set the view to active and it this works all the tabs/forms appear.
Since you are saying that the View is not really needed, and the window should hide() / open() and remember the contents, I will try to see if I can make this work.
I found this post: viewtopic.php?f=14&t=11927 where the person is trying to do the same thing. Are you certain that hide() / show() will remember the tab/forms so it is necessary to attach the tab group again?
Based on your recommendations, it’s now doing this: (and it is much faster)
when screen is first accessed, show mainLayout with grid
prepare the window: open it, create layout, tabs, attach forms, form event handlers, create new datastore for forms, hide window
when row in grid is double clicked: ajax load the data form datastore, mainLayout.progressOn(), hide unneeded tabs (the grid datastore has this information), then wait for form datastores’s onXLE
in form’s onXLE: setCursor to last record, bind the first tab to datastore, show window, set first tab active, then setTimeout(bindOtherTabs,5), mainLayout.progressOff()
The first tab is shown as quickly as possible and then 5ms later the other 11 tabs are get bound to the datastore.
Do you think this approach is ok? It is very fast.
You are in the right direction. It will work well, as you finished. See in my laptop what happens is, I have already enabled the taskbar hiding but the taskbar won’t hide in fullscreen. Due to this, I am not able to see the screen properly.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan