Perfomace problems using WebDbGrid options

If you set the option of WebDbGrid to goColSizing, goColMoving .., the loading speed of the grid deteriorates with each opening and closing of TWEbClientDataSet. If you look at the number of events on the monitor under Chrome, you will see that the number of registered events doubles with each opening. This means that the browser needs a lot of time to analyze all registered events. The network works fine, only the charging performance deteriorates.

I have retested this here with the demo Basics\Demo\DBGrid where the code was added to open/close with a checkbox:
WebClientConnection1.Active := webcheckbox1.Checked;
and I monitored the nr. of event handlers and this remained stable.
What are you doing different? How exactly can we reproduce this with v1.5.6.0?

Hello Bruno,

I am currently using version 15.6.0.

The effect occurs when you use two WebDBGrid as master slaves in a form. The WebClientConnection and the WebClientDataset are located in a datamodule. The datasource is located in the form and is connected to the dataset at runtime.

The following working method is used:

//Master
MasterWebClientConnection.Active: = false;
MasterWebClientConnection.URI: = sURI;
// Delete all the fields and produce thereafter
toolsXE_SetFieldDefs (MasterWebClientDataSet);
MasterWebClientOrderPositionsConnection.Active: = TRUE;

// Detail, event AfterScroll (Master)
DetailWebClientConnection.Active: = false;
DetailWebClientConnection.URI: = sURI (Prams from Master);
// Delete all the fields and produce thereafter
toolsXE_SetFieldDefs (DetailWebClientDataSet);
DetailWebClientOrderPositionsConnection.Active: = TRUE;

I have now tried several times with and without the options described, I have been observing this for a long time, but could not yet explain this behavior to myself. It looks as if the existing event entries remain and new events are added after the client connection is reopened.

Is there a way to display the assigned events in the listener or to export them (Chrome/Firefox)?

Greetings Frank

Put this code in the Chrome dev tools console to count the nr. of event listeners

Array.from(document.querySelectorAll('*'))
  .reduce(function(pre, dom){
    var clks = getEventListeners(dom).click;
    pre += clks ? clks.length || 0 : 0;
    return pre
  }, 0)