this.obj.firstChild is null in popup with attached grid

I am trying to load data from a larger grid into a smaller popup grid on right click. I am using popGrid.init() and I am still getting the this.obj.firstChild is null error. Any ideas what could be wrong here? Could this be throwing this error because the number of rows in transArr is not equal for all elements in the array? In other words, it is not a symmetrical array.


function transposeVals(xmlConfigDoc, mygrid, myPop) {
	var myPop = new dhtmlXPopup();
	var popGrid; 
	var rowid = mygrid.getSelectedRowId();
	var data = mygrid.getRowData(rowid);
	var subarray = $.map(data, function(value,index){
		return[value];
	});
	var popupArr = [];
	var transArr = [];
	var i = "";
	var x = 0;
	var m = 0;
	for ( i = 1; i < subarray.length; i++) {
		if (subarray[i].includes(";")) {
			popupArr[x] = subarray[i];
			x ++;
		};
	};
	popGrid = myPop.attachGrid(350, 300);
	popGrid.init();
	for (m= 0; m < popupArr.length; m++){
		transArr[m] = popupArr[m].split(';');
	};
	
	popGrid.parse(transArr, "jsarray");
	myPop.show(20,20,400,300);
}

You need to define the header for your grid:
popGrid = myPop.attachGrid(350, 300);
popGrid.setHeader("…your columns…")
popGrid.setColTypes("…your column types…")
popGrid.setInitWidths("…widths of your columns…")
//…
popGrid.init();