dhtmlXVault - Reload the DhtmlXGrid after uploading the file

dhtmlXVault - Reload the DhtmlXGrid after uploading the files with the attachment details.



The below code works fine if the record is already existing, incase if is the first attachment uplooded , mygrid.getRowsNum always return a zero where as it should be “1”



if (mygrid.getRowsNum() > 0)

{

var pnl = document.getElementById(‘ctl00_Body_pnlAttachmentGrid’);

pnl.style.display = ‘inline’;

//alert(‘inside loop’);

}





We are calling the generateGrid() method in dhtmlxVault.js as below



if (this.isUploadFileAll == “true”)

{ this.uploadAllItems(); };

if(typeof generateGrid == “function”)

{ generateGrid();}

Its not pretty clear from provided snippet, but please beware , if you are using grid.load operation - it is async., so you need to catch the moment of data loading before executing any data related operation. ( onXLE event or second parameter of load command )