Please help me with dynamic data loading.....
Hi All
I went through the forum for the above topic, I found many entries, but I have some specific question on this dynamic data loading. Here is my HTML Code.
======================================================
======================================================
Here is my js file
=====================================================
=====================================================
I want to populate the data returned by the GetXMLData function, which in turn calls a ASP page using HTTPRequest.
The data returned by HTTPRequest in a array with delimiter "|". I split it in the js file and taking the first element aND assignign to the row count.
The second element in the array is the data, which is returned in the following format.
["12345","3/16/2006","ABC","This is test","1","DealerQuote","3/16/2006","Quoted"].
and assigned to the listdata variable.
Now my question is how do I set the data to the grid.
"objRepair.setDataProperty("text",function(i,j){return listdata[i][j]});"
The above statement is returning an error "listdata[...] is null or not an object".
I will appreciate if some one in this forum can help solving the problem. I am struggling to get the basic grid working for more than a week.
Thanks in advance
prao
I went through the forum for the above topic, I found many entries, but I have some specific question on this dynamic data loading. Here is my HTML Code.
======================================================
<%@ Language=VBScript %>
<% Response.Buffer=True %>
<% Response.Expires = 0 %>
<html>
<head><title></title>
<LINK REL=STYLESHEET TYPE="text/css" HREF="/RGA_New/css/Royal.css">
<LINK REL=stylesheet TYPE="text/css" href="/RGA_New/runtime/styles/xp/grid.css"></link>
<script src="/RGA_New/source/lib/grid.js"></script>
<script src="/RGA_New/runtime/lib/paging1.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="/RGA_New/js/RoyalCommon.js"></SCRIPT>
<style>
.active-controls-grid {width: 1080; height: 500; font: menu; background-color: #FFFFFF;}
.active-column-0 {width: 50px;}
.active-column-1 {width: 80px;}
.active-column-2 {width: 200px;}
.active-column-3 {width: 250px;}
.active-column-4 {width: 50px;}
.active-column-5 {width: 180px;}
.active-column-6 {width: 80px;}
.active-column-7 {width: 80px;}
.active-column-0 {text-align: left;}
.active-column-1 {text-align: left;}
.active-column-2 {text-align: left;}
.active-column-3 {text-align: left;}
.active-column-4 {text-align: right;}
.active-column-5 {text-align: left;}
.active-column-6 {text-align: left;}
.active-column-7 {text-align: left;}
.active-grid-column {border-right: 1px solid threedlightshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow; height: 20px;}
</style>
</head>
<body>
<TABLE>
<TR><TD CLASS="Label">Repair Quote#:</TD>
<TD CLASS="Label"><INPUT FORMNAME="REPAIR" CLASS="Text" TYPE=TEXT ID="logid" SIZE=20 NODISABLE='Y'> <img src="/RGA_New/imgs/ico_go.gif" border=0 onclick="javascript:Form_FetchData(document.all.logid.value);"></TD></TR>
<tr><td><span id=message></span></td></tr>
</TABLE><BR>
<DIV id="GridDiv">
<script>
var list_columns=["Quote#","Date","Name","Comments","Qty","Quote Type","Quote Date","Status"];
objRepair = new Active.Controls.Grid;
//objRepair.setId("G1");
objRepair.setColumnProperty("count", 8);
objRepair.setColumnProperty("text", function(i){return list_columns[i]});
document.write(objRepair);
</script>
</DIV>
<SCRIPT LANGUAGE="JavaScript" SRC="/RGA_New/js/Repair.js"></SCRIPT>
</body>
</html>
======================================================
Here is my js file
=====================================================
function Form_Load() {
try {
//create_gridobj()
Form_FetchData();
} catch(e) {
alert("Repair.js:Form_Load - Error: (" + e.description + ")");
}
}
function Form_FetchData() {
try {
var url="/RGA_New/xml/Listdata.asp?sid=" + Math.random();
var result=[b]GetXMLData(url);[/b]
var sdata=result.split("|");
[b]var listdata=[sdata[1]];[/b]
objRepair.setDataProperty("count",sdata[0]);
[b]objRepair.setDataProperty("text",function(i,j){return listdata[i][j]});[/b]
objRepair.refresh();
} catch(e) {
alert("Repair.js::DataRequest - Error: (" + e.description + ")");
}
}
function create_gridobj() {
var list_columns=["Quote#","Date","Name","Comments","Qty","Quote Type","Quote Date","Status"];
objRepair = new Active.Controls.Grid;
//objRepair.setId("G1");
objRepair.setColumnProperty("count", 8);
objRepair.setColumnProperty("text", function(i){return list_columns[i]});
document.write(objRepair);
}
window.onload = Form_Load;
=====================================================
I want to populate the data returned by the GetXMLData function, which in turn calls a ASP page using HTTPRequest.
The data returned by HTTPRequest in a array with delimiter "|". I split it in the js file and taking the first element aND assignign to the row count.
The second element in the array is the data, which is returned in the following format.
["12345","3/16/2006","ABC","This is test","1","DealerQuote","3/16/2006","Quoted"].
and assigned to the listdata variable.
Now my question is how do I set the data to the grid.
"objRepair.setDataProperty("text",function(i,j){return listdata[i][j]});"
The above statement is returning an error "listdata[...] is null or not an object".
I will appreciate if some one in this forum can help solving the problem. I am struggling to get the basic grid working for more than a week.
Thanks in advance
prao
March 16,