AW.XML.Table - No data displayed.
Hi Alex,
I am facing issue with data display using AW.XML.Table. This issue is not reproducible.
I think there is something wrong the way response is handled in our code. I've analysed code but could not find the reason why grid is showing unexpected behaviour once in 100 requests . I would like to request you to analyse the code snippets written below and suggest me what can be wrong.
On click of Search..
table.setAsync(true);
table.setRequestMethod("POST");
table.setURL(url);
table.request();
Code used to render grid :-
table = new AW.XML.Table;
var obj = new AW.Grid.Extended;
var headerArray = ["","First Name","","Last Name", "Profession" , "" , ""];
var columnArray = ["","firstname","","lastName","profession","salary","designation"];
var columnList = [0,1,3,4];
table.setColumns(columnArray);
obj.setId("obj");
obj.setStyle("width","100%");
obj.setStyle("height","120px");
obj.setColumnCount(columnArray.length);
obj.setCellModel(table);
obj.setRowCount(table.getCount());
obj.setHeaderText(headerArray);
obj.setSelectionMode("multi-cell");
obj.setVirtualMode(true);
obj.setColumnIndices(columnList);
obj.setCellFormat([select, str, str, str]);
obj.setSortColumn(1);
obj.sort(1,"ascending");
// Response handling
table.response1 = table.response;
table.response = function(data){
this.response1(data);
if(table.getCount()==0)
{
document.getElementById("msgCol").innerHTML = "No record found";
}
else if(table.getCount()>0)
{
if(table.getCount() == 1)
{
document.getElementById("msgCol").innerHTML = "1 Record found";
};
}
Sometimes table.getCount() returns records but grid is blank with horizontal and vertical scrollbars visible(Message is displayed 1 Record found but grid is blank). But nexttime when search is executed it behaves as expected.
Please suggest whats wrong in the code.
Thanks and Regards,
Ritu Sharma
I am facing issue with data display using AW.XML.Table. This issue is not reproducible.
I think there is something wrong the way response is handled in our code. I've analysed code but could not find the reason why grid is showing unexpected behaviour once in 100 requests . I would like to request you to analyse the code snippets written below and suggest me what can be wrong.
On click of Search..
table.setAsync(true);
table.setRequestMethod("POST");
table.setURL(url);
table.request();
Code used to render grid :-
table = new AW.XML.Table;
var obj = new AW.Grid.Extended;
var headerArray = ["","First Name","","Last Name", "Profession" , "" , ""];
var columnArray = ["","firstname","","lastName","profession","salary","designation"];
var columnList = [0,1,3,4];
table.setColumns(columnArray);
obj.setId("obj");
obj.setStyle("width","100%");
obj.setStyle("height","120px");
obj.setColumnCount(columnArray.length);
obj.setCellModel(table);
obj.setRowCount(table.getCount());
obj.setHeaderText(headerArray);
obj.setSelectionMode("multi-cell");
obj.setVirtualMode(true);
obj.setColumnIndices(columnList);
obj.setCellFormat([select, str, str, str]);
obj.setSortColumn(1);
obj.sort(1,"ascending");
// Response handling
table.response1 = table.response;
table.response = function(data){
this.response1(data);
if(table.getCount()==0)
{
document.getElementById("msgCol").innerHTML = "No record found";
}
else if(table.getCount()>0)
{
if(table.getCount() == 1)
{
document.getElementById("msgCol").innerHTML = "1 Record found";
};
}
Sometimes table.getCount() returns records but grid is blank with horizontal and vertical scrollbars visible(Message is displayed 1 Record found but grid is blank). But nexttime when search is executed it behaves as expected.
Please suggest whats wrong in the code.
Thanks and Regards,
Ritu Sharma
January 16,