Window Initaliztion

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?

Hello
You can do a little different way:

  1. create layout + grid + window (hide)
  2. 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)
  3. 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)
  4. load direact form to the direct tab once, but you can to not load it, if your tab will not come active
  5. 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?

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.

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?

hmmmm… strange…

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 :blush:

Based on your recommendations, it’s now doing this: (and it is much faster)

  1. when screen is first accessed, show mainLayout with grid

  2. prepare the window: open it, create layout, tabs, attach forms, form event handlers, create new datastore for forms, hide window

  3. 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

  4. 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. :slight_smile:

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.