Remote subgrid loading image

I’ve configured a dhtmlxgrid to load a subgrid via the dhtmlxConnector. As the subgrid data can be quite large, it takes some time for the subgrid to populate. I would like to give the user some feedback to show that it is loading and thus would it be possible to show a loading image in the subgrid while waiting for the response from the server? And when the response returns, the loading image will be replaced with the actual data items.

There are two events which can be used for that

  • onSubGridCreated
  • onSubGridLoaded

Thanks. I’m trying to show the loading image in the subgrid as illustrated in the attachment

From onSubGridCreated event you have access to subgrid object

subgrid.hdr will give you access to the html element of subgrid’s header

Thanks Stanislav. While I didn’t use the header you set me in the right direction.

Managed to create a new HTML element to do so. Code below using jQuery for reference if anybody needs it.

	jQuery(subgrid.objBox).prepend("<div><img class='loading' src='/images/loading.gif'></div>");
	return true; // mandatory!
	jQuery(subgrid.objBox).find("img.loading").eq(0).hide(); // hide after data is loaded