Javascript: Dynamically loading grid in classic asp
I am trying to dynamicall load the grid using an object but in vain
I have 2 code snipnets:
data = "Contract1":["S1234", "62,615.266","7-Dec-2007"],
"Contract1":["S1234", "62,615.266","7-Dec-2007"]
if 'data' is an asp variable
<script>
var myData = {<%=data %>};
grid.setDataText(function(i, j){return myData[i][j]});
grid.setProperty("selection/index", 0);
grid.refresh();
</script>
works fine
However if 'data' is javascript variable
<script>
var myData = {data };
grid.setDataText(function(i, j){return myData[i][j]});
grid.setProperty("selection/index", 0);
grid.refresh();
</script>
doesn't work. What could be wrong somebody help!
I have 2 code snipnets:
data = "Contract1":["S1234", "62,615.266","7-Dec-2007"],
"Contract1":["S1234", "62,615.266","7-Dec-2007"]
if 'data' is an asp variable
<script>
var myData = {<%=data %>};
grid.setDataText(function(i, j){return myData[i][j]});
grid.setProperty("selection/index", 0);
grid.refresh();
</script>
works fine
However if 'data' is javascript variable
<script>
var myData = {data };
grid.setDataText(function(i, j){return myData[i][j]});
grid.setProperty("selection/index", 0);
grid.refresh();
</script>
doesn't work. What could be wrong somebody help!
Peter Muchiri
February 10,