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:
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?
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.
When the user closes the window, this should really be a hind() and then clear the forms.
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?
You can do a little different way:
- create layout + grid + window (hide)
- bdl click shows window and loads all the tabs and the fore, which is in the shown tab (the active one, which you will see after loading the window)
- when other tab will be active - load its form there (when i say ‘form’ - i mean all the form features ab binding, data store and form event handlers)
- load direact form to the direct tab once, but you can to not load it, if your tab will not come active
- onClose window set calerAll for all the forms and hide window
I hope that described it enough similar, and you will understand everything.
Thank you for the guidance.
So you’re saying to create the window when the page loads, then hide it.
Then each time the user clicks on the row in the grid, open the window and build the tabs.
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?
Will using a View make this more efficient / faster / better?
One more idea!
You can use ‘onXLE’ event or callback in ‘loadXML’ method to load your forms to the tabs.
Or your forms will be formed depending on row id?
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?
Found the problem:
The window.hide() needs to come after the tab group is built. Perfect!!! Window hides and shows and all tab groups are intact.
Soory, i forgot to mention it
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.
Yes, of course. You can do it this way. As far as you did it and it works 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.