Hi Farshad:
I was playing around, thinking about a design to minimize network traffic, when I noticed the following whilst having the Chrome Debug Console open.
I basically have a panel that is collapsible to the left. I noticed that every time I would collapse or expand the panel it would send an AjaRequest to the server (handleEvent) even though nothing is assigned to the OnCollapse or OnExpand events in Delphi. Below is the temporary code that UniGUI generated for this.
O22C.on("collapse", function () {
ajaxRequest(O22C, "collapse", ["w=" + O22C.getWidth(), "h=" + O22C.getHeight()])
});
O22C.on("expand", function () {
ajaxRequest(O22C, "expand", ["w=" + O22C.getWidth(), "h=" + O22C.getHeight()])
});
Now I might be wrong or maybe don't fully understand the design but could we not maybe cut down on network traffic in this case by not generating any code for an AjaxRequest if no "Event" code for OnCollapse or OnExpand were assigned? If this holds true then it can have a huge impact on performance, especially with a significant number of users. Is there any other places where this logic can be applied as well?