:: Forum >>

performance help

So.. hopefully someone can help me out here:

When I turn on virtual mode, the initial render of the grid(s) on my page are relatively quick; however scrolling is really quite painful.

When I turn off virtual mode, the initial render is painful, but scrolling isn't *too* bad.

FWIW, the tables I'm talking about here have around 200 rows with anywhere from 4 to 15 columns.

I use the "xml ajax" mode for populating the data for the grids (using the AW.XML.Table object).

I've cut a sample rendering javascript and pasted it in below (and yes I know that it's not the most attractive javascript in the world... but in part, it's autogenerated).

If anyone can give me some pointers on how to make this perform alot better, let me know; and I really appreciate any help.

var rowCount=30;
var headerLinks=[
"http://localhost/s3/c/portal/layout?p_l_id=PUB.1002.1&p_p_id=middle_portlet_WAR_s3portal&p_p_action=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-2&p_p_col_pos=1&p_p_col_count=3&_middle_portlet_WAR_s3portal__sort=8&_middle_portlet_WAR_s3portal__render=&#p_middle_portlet_WAR_s3portal",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""];
var sortCol=-1;
var sortDesc=false;
// define column labels
var columns = ["Circuit ID","Workgroup Assignment","Workgroup Status","Master Circuit Status","Workstream","Circuit Type","Category","Vendor Name","Bank BLC Z","Z Site Type","Z Zip","MRC with Taxes Surcharges","Batch ID","IW Disconnect Indicator","Accrual Date"];
// create ActiveWidgets Grid javascript object
var reportGrid = new AW.Grid.Extended;
var reportRow = reportGrid.getRowTemplate();

reportGrid.setVirtualMode(true);
reportGrid.setStyle("width",668);
// provide column labels
reportGrid.setHeaderText(columns);
reportGrid.setColumnCount(15);
// reportGrid.setRowCount(rowCount);
// define data formats
var labeledNum = new AW.Formats.Number;
labeledNum.dataToTexti = labeledNum.dataToText;
labeledNum.dataToText = function(data) {
var parts = data.split("##");
if (parts.length > 1)
{
return "<table width='100%' border='0'><tr><td align='left'>"+parts[0]+"</td><td align='right'>"+this.dataToTexti(parts[1])+"</td></tr></table>";
}
else
{
return this.dataToTexti(data);
}
};
var str = new AW.Formats.String;
var num = new AW.Formats.Number;
var date = new AW.Formats.Date;
date.setDataFormat("ISO8601");
date.setTextFormat("mm/dd/yyyy hh:mm");
// set data formats
reportGrid.setCellFormat([str,str,str,str,str,str,str,str,str,str,str,str,str,str,str]);
// set row selection
reportGrid.setSelectionMode("single-row");
reportGrid.onRowMouseDown = function(event, index){ return true;}; //disable select on click
// write grid html to the page
document.write(reportGrid);
// reportGrid.setCellText(reportData);
var reportNow = new Date();
var xmlReportData = new AW.XML.Table;
xmlReportData.setURL('/s3portal/modlets/AWTableData');
xmlReportData.setRequestMethod('POST');
xmlReportData.setParameter('FILE_PARM_NAME','/data/portal/liferay/ext/servers/tomcat/temp/omsSearchBANK_BLC_Z__CA0_130_AND_OR_SEARCH__AND__RUNNING_REPORT_NAME__omsSearch53035.xml');
xmlReportData.setParameter('START_ROW_PARM_NAME','0');
xmlReportData.setParameter('ROW_COUNT_PARM_NAME','100');
xmlReportData.setParameter('REPORT_NAME_PARM_NAME','omsSearch');
xmlReportData.setParameter('BASE_ACTION_URL','http://localhost/s3/c/portal/layout?p_l_id=PUB.1002.1&p_p_id=middle_portlet_WAR_s3portal&p_p_action=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-2&p_p_col_pos=1&p_p_col_count=3');
xmlReportData.setParameter('REPORT_DATA_SOURCE_NAME','oms');
xmlReportData.setParameter('RENDERABLE_COLUMN_NAMES','CIRCUIT_ID,WORKGROUP_ASSIGNMENT,WORKGROUP_STATUS,MASTER_CIRCUIT_STATUS,WORKSTREAM,CIRCUIT_TYPE,CATEGORY,VENDOR_NAME,BANK_BLC_Z,Z_SITE_TYPE,Z_ZIP,MRC_W_TAXES_SURCHARGES,BATCH_ID,IW_DISCONNECT_INDICATOR,ACCRUAL_DATE,CIRCUIT_ID');
xmlReportData.setParameter('BROWSER_TZ_OFFSET','-'+reportNow.getTimezoneOffset());
xmlReportData.getLink = function(col,row) {
var realCol = (col * 1)+15;
var node = this.getNode(realCol,row);
if (node != null)
{
var retval = AW.ie ? node.text : node.textContent;
return retval;
}
return "#";
};
reportGrid.setCellModel(xmlReportData);
xmlReportData.request();

var SortFunction = function(event,index){
var headerLink = headerLinks[index];
if (headerLink.length == 0)
{
return "disabled";
}
return "";
};
reportGrid.onHeaderClicked = SortFunction;
reportGrid.setSelectorVisible(false);
var colLink0 = new AW.Templates.Link;
colLink0.setEvent("onclick",minimizeControls);
reportGrid.setCellTemplate(colLink0, 0);
reportGrid.setStyle("height",200);
reportGrid.setColumnWidth('200',0);
reportGrid.setColumnWidth(100,1);
reportGrid.setColumnWidth(100,2);
reportGrid.setColumnWidth(100,3);
reportGrid.setColumnWidth(100,4);
reportGrid.setColumnWidth(100,5);
reportGrid.setColumnWidth(100,6);
reportGrid.setColumnWidth(100,7);
reportGrid.setColumnWidth(100,8);
reportGrid.setColumnWidth(100,9);
reportGrid.setColumnWidth(100,10);
reportGrid.setColumnWidth(100,11);
reportGrid.setColumnWidth(100,12);
reportGrid.setColumnWidth(100,13);
reportGrid.setColumnWidth(100,14);
reportGrid.refresh();
Gary
Friday, May 19, 2006

This topic is archived.


Back to support forum

Forum search