Dear Alex,
I am using demoversion to check whether it suits our site or not.
I m facing some problems, please help me to sort it out.
I used virtual mode - false. but still page rendering is very slow. it taking 5 to 10 mins to display the data of 700 rows and 10 columns, having one column with HyperLink.
more over IE showing following warning message___
"A script on this page is causing Internet Explorer to run slowly, if it continues to run your computer may become unresponsive.
Do you want to abort the script?
Yes No
"
MY PC Cong.
Intel P4 2.00 GHz
256 MB RAM.
CPU Usages: 100%
PF Usages: 507 MB
for 3 mins.
Please Help me regarding this performance issue.
Ashish Dhanorkar [Ashida001@gmail.com]
Friday, February 15, 2008
Ashish,
I'm a different Alex from the one you are addressing, but I'm guessing I may have a clue as to why the grid is slow. Virtual mode needs to be turned on for grid to be faster, so you set it to true not false.
Alex Ndungu
Friday, February 15, 2008
>> I used virtual mode - false.
You should keep virtual mode = true for the large datasets. Switching off virtual mode is only suitable for the small grids (less than 100 rows).
Alex (ActiveWidgets)
Friday, February 15, 2008
Hey ALEX,
THANKS BOTH OF U....
BUT STILL I M FACING SAME PROBLEM... EVEN AFTER ALTERING THE VERTUAL MODE BETWEEN "TRUE" AND "FALSE".....
STILL IT TAKING SAME TINE [~2 MINS] TO LOAD DATA IN GRID...
IF U CAN SPARE SOME TIME AND TRY MY CASE, U MAY FOUND MY MISTAKE WHICH CAUSING THIS PROBLEM
u can try the explample taking 700 rows and 9 cols and following data...
>> Code goes here <<
<span id="grid1"></span>
>> Break <<
>> Javascript Code <<
function onpenNewWinCompIPO(cLink,cTitle)
{
window.open(cLink,cTitle,'scrollbars=yes,resizable=yes,top=150,left=150,width=430,height=320')
}
I think it could be faster since it runs on the server and sends the completed data to the browser for processing by AW.
Alex Ndungu
Wednesday, February 20, 2008
Thanks Alex,
as u said I tried with the arrays, its really incredibly fast.
but as I need
OnClick - some PopUp should open
or applying different styles to columns as per need of data
or changing font color in individual CELL as per data; like credit amount should appear in GREEN and debit amount should appear RED...
such Cell Level scripting i not able to perform with arrays...
in previous code i used OnClick on 2nd column.
but now code which i m giving is like what u said in ur replay...
>>>>> Code Start <<<<<
'''''''' ASP Code ''''''''''
dim grRowNum
grRowNum = 0
dim vScript, noOfRows
vScript = ""
noOfRows = rsq.recordcount
vScript = vScript & "[" & vbCrLf
while rsq.EOF=false
dim xyz,v
xyz=rsq(5)
if xyz="5" then
v="Bill"
end if
if xyz="4" then
v="Payment"
end if
if xyz="3" then
v="Receipt"
end if
if xyz="2" then
v="JournalVoucher"
end if
if xyz="1" then
v="OpenEntry"
end if
''' Comment - creating varialble for array
if(rsq(0)) ="0" then
vScript = vScript & "['',"
else
vScript = vScript & "['" & convertdateddmmyyyy(rsq(0)) & "',"
end if
if xyz="5" then
vScript = vScript & "'" & Trim(rsq(1)) & "',"
else
vScript = vScript & "'" & Trim(rsq(1)) & "',"
end if
if(rsq(2)) ="0" then
vScript = vScript & "'',"
else
vScript = vScript & "'" & Trim(rsq(2)) & "',"
end if
if(rsq(3)) ="0" then
vScript = vScript & "'',"
else
vScript = vScript & "'" & Trim(rsq(3)) & "',"
end if
if(rsq(4)) ="0" then
vScript = vScript & "'',"
else
vScript = vScript & "'" & Trim(rsq(4)) & "',"
end if
if(rsq(6)) = "0" then
vScript = vScript & "'',"
else
vScript = vScript & "'" & formatnumber(rsq(6),2) & "',"
end if
if(rsq(7)) = "0" then
vScript = vScript & "'',"
else
vScript = vScript & "'" & formatnumber(rsq(7),2) & "',"
end if
db=cdbl(rsq(6))
cr=cdbl(rsq(7))
if x<>"" then
end if
bal = (db-cr)+runbal
if bal > 0 then
color = "red"
bal_val = formatnumber(round((abs(bal)),2),2) & " Dr"
else
color = "green"
bal_val = formatnumber(round((abs(bal)),2),2) & " Cr"
end if
vScript = vScript & "'" & bal_val & "']"
grRowNum = grRowNum + 1
runbal = bal
rsq.MoveNext
if not rsq.eof then
vScript = vScript & "," & vbCrLf
end if
wend
vScript = vScript & "];"
'''''''''''''' ASP Code End ''''''''''''''
%>
<script language=JavaScript>
var arrData = <%=vScript%>
function onpenNewWinCompIPO(cLink,cTitle)
{
window.open(cLink,cTitle,'scrollbars=yes,resizable=yes,top=150,left=150,width=430,height=320')
}
// create ActiveUI Grid javascript object
var grid = new AW.UI.Grid;
grid.setId("grid1");
// provide cells and headers text
grid.setCellText(myData);
grid.setHeaderText(myColumns);
// set rows ids
grid.setRowIndices(myRowIDs);
// set number of columns and rows
grid.setColumnCount(colCount);
grid.setRowCount(rowCount);
//load the URLs
<%= cellUrl %>
//set the URL template for column 1
grid1.setCellTemplate(new AW.Templates.Link,1);
// write grid html to the page
document.write(grid);
</script>
Alex Ndungu
Thursday, February 21, 2008
correction:
1) change
grid1.setCellTemplate(new AW.Templates.Link,1);
to
grid.setCellTemplate(new AW.Templates.Link,1);
2) change
cellUrl = cellUrl & "grid1.setCellLink(""javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')"",1," & rowCount & ");" & vbCrLf
to
cellUrl = cellUrl & "grid.setCellLink(""javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')"",1," & rowCount & ");" & vbCrLf
Alex Ndungu
Thursday, February 21, 2008
THANKS ALEX,
THIS WAS REALY IMPRESSIVE SCRIPT, I GOT REALY GREATE IDEAS TO PLAY WITH THE GRID.
BUT STILL PROBLE IS: ON CLINKING ON CELL WITH LINK IT DOING NOTHING.
I M GIVING U """ HTML CODE """ TO TEST.
PLEASE REFFER ME CHECKING IN UR CODE GIVEN BEFORE.
var rowCount = 8;
var colCount = 9;
var myColumns = ["Date", "Reference No", "Exch", "Bank", "Cheque", "Description", "Debit", "Credit", "Balance"];
var myRowIDs = ["4/1/2007","4/26/2007","5/10/2007","6/22/2007","7/3/2007","7/14/2007","12/5/2007","2/20/2008"];
var myData = [];
myData["4/1/2007"] = ["4/1/2007","OPNGRTBSE 0 "," "," ","BY OPENING BALANCE B/F,,,","1","0","6632.06","BSE "];
myData["4/26/2007"] = ["4/26/2007","PYIBAPR0000311","ICCLTCASHB","*TFR ","YOUR A/C. HAS BEEN DEBITED TOWARDS :,ON A/C,Cr to ICICI BANK A/c No. 000401013509,25/04/2007-2","4","6000","0","BSE "];
myData["5/10/2007"] = ["5/10/2007","DR/026/---20 "," "," ","By Bill DR/026/---20 for Ex: BSE,- BT: DEPOSITORY - Settlement=2007026,,","5","0","48469.6","BSE "];
myData["6/22/2007"] = ["6/22/2007","PYIBJUN0000361","ICCLTCASHB","*TFR ","YOUR A/C. HAS BEEN DEBITED TOWARDS :,ON A/C,Cr to ICICI BANK A/c No. 000401013509,21/06/2007-2","4","49101.66","0","BSE "];
myData["7/3/2007"] = ["7/3/2007","JVJUL_C0001652"," "," ","Tr DP Dr of BO#024454 to 1750,,,","2","347.95","0","BSE "];
myData["7/14/2007"] = ["7/14/2007","REIC07B0001115"," "," ","CHQ-0493389-13/07/2007,I.C.I.C.I. BANKING CORPORATION LTD.-NARIMAN P,RT-17609-8311,","3","0","348","BSE "];
myData["12/5/2007"] = ["12/5/2007","JVDEC_C0003352"," "," ","Trf Dp Dr - Bo#024454 To 1750 ","2","28.09","0","BSE "];
myData["2/20/2008"] = ["2/20/2008","REIC02B0003000"," "," ","Nt-0000000-20/02/2008 I.c.i.c.i. Banking Corporation Ltd.-nt Rt-58800-58800 ","3","0","30","BSE "];
// create ActiveUI Grid javascript object
var grid = new AW.UI.Grid;
grid.setId("grid");
// provide cells and headers text
grid.setCellText(myData);
grid.setHeaderText(myColumns);
// set rows ids
grid.setRowIndices(myRowIDs);
// set number of columns and rows
grid.setColumnCount(colCount);
grid.setRowCount(rowCount);
//load the URLs
grid.setCellLink("javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')",1,0);
grid.setCellLink("javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')",1,1);
grid.setCellLink("javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')",1,2);
grid.setCellLink("javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')",1,3);
grid.setCellLink("javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')",1,4);
grid.setCellLink("javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')",1,5);
grid.setCellLink("javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')",1,6);
grid.setCellLink("javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')",1,7);
//set the URL template for column 1
grid.setCellTemplate(new AW.Templates.Link,1);
// write grid html to the page
document.write(grid);
//grid1.refresh();
</script>
</BODY>
</HTML>
>>>>>>>>> CODE ENDS HERE <<<<<<<<<<<<<
PLEASE FIND BUG IN MY CODE AND LET ME KNOW....
WARM REGARDS,
ASHISH DHANORKAR.
Ashish Dhanorkar [Ashida001@gmail.com]
Friday, February 22, 2008
Ashish,
The problem seems to be with the row ids. This line:
grid.setCellLink("javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')",1,0);
attempts to assign the url to the first row by calling it row 0. This is the bug since the row is called "4/1/2007" as indicated by the myRowIDs array. This means that the cell link should be assigned with the following kind of reference:
grid.setCellLink("javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')",1,"4/1/2007");
In order to produce this kind of code, the ASP code I sent earlier needs to be modified such that the line:
cellUrl = cellUrl & "grid.setCellLink(""javascript:onpenNewWinCompIPO('bill.asp?title=Bill%20Details&e=ALL&b=2007003&v=BSE &cc=60366 &brc=RT &r=DR/003/---92 &d=4/4/2007&da=0&cam=1590957.99&cn=VIRESH P SHAH ','Comp')"",1," & rowCount & ");" & vbCrLf