CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Speed Performance of Editable Grid with javascript

Print topic Send  topic

Author Message
swilson


Posts: 84
Posted: 01/16/2006, 4:12 PM

Normally it takes 2 seconds for my editable grid to return the data and display 182 rows of data.

When I add the any javascript in the On Change of a field, the page takes 22 seconds to load - no matter what the script contains.

Is this to be expected?
_________________
It continues to amaze me, how often the solutions to seemingly complex problems are so very simple.
View profile  Send private message
peterr


Posts: 5971
Posted: 01/17/2006, 3:48 AM

I dont know why this happens but I suspect that maybe the page loads fast while the Web browser (IE) is then taking long time to analyze and process 182 JavaScript functions and bind them to 182 controls. Assuming that such On Change script was added to each data row.
You could try checking the HTML source of that page just to evaluate the size and number of functions in it. Maybe you would consider displaying smaller number of records per page.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
swilson


Posts: 84
Posted: 01/17/2006, 6:21 AM

I think you're right Peter. In this case, I only wanted the Java script to occur on the Empty Row. (I only have one.) How can I add javascript only to the last row?

Regarding page size, there do not seem to be problems there.

Here's a test script that does nothing more than say "Hello Matthew" on change of the Model Listbox. It seems to me that there is a hangup with the browser assigning the script to each and every row. Please help me understand how to cause it to apply the script only to the last or empty row(s).

//Begin CCS script  
//Include JSFunctions @1-6C079973  
  </script>  
  <script language="JavaScript" type="text/javascript" src='ClientI18N.aspx?file=Functions.js&locale=en'></script>  
  <script language="JavaScript" type="text/javascript">  
    
//End Include JSFunctions  
  
//page_Equipment_Model_OnChange @24-D586869A  
function page_Equipment_Model_OnChange()  
{  
    var result;  
//End page_Equipment_Model_OnChange  
  
//Confirmation Message @42-AE8FD98C  
    return confirm('Hello Matthew!');  
//End Confirmation Message  
  
//Close page_Equipment_Model_OnChange @24-BC33A33A  
    return result;  
}  
//End Close page_Equipment_Model_OnChange  
  
//bind_events @1-F793B1FB  
function bind_events() {  
    if(typeof(initEquipmentElements) == "function")  
        initEquipmentElements();  
    if(typeof(initEquipmentElements) == "function"){  
        for(var i = 0; i < EquipmentElements.length; i++){  
            check_and_bind("EquipmentElements["+i+"][EquipmentModelID]", "onchange", page_Equipment_Model_OnChange);  
        }  
    }  
    forms_onload();  
}  
//End bind_events  
  
window.onload = bind_events; //Assign bind_events @1-19F7B649  
  
//End CCS script  
</script>

_________________
It continues to amaze me, how often the solutions to seemingly complex problems are so very simple.
View profile  Send private message
peterr


Posts: 5971
Posted: 01/17/2006, 3:01 PM

Unfortunately I may know less about JavaScript syntax than you do, so I couldn't get into such details. Let's see if anyone else on the forums could propose a solution. You could also try checking with the support regarding general approach.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
dragoon


Posts: 173
Posted: 01/21/2006, 7:20 AM

have you tried to put the event directly in the code and not user the codecharge's OnChage event?

regarding to put it in the empty row only, I think you can't. (you're developing in .NET, right? 8-)).

I did once in ASP to add costom code in server controls. Here's how :
http://forums.yessoftware.com/posts.php?post_id=65706

if in .NET we had a similar run-time function like that in ASP...

View profile  Send private message
Intexk
Posted: 01/25/2006, 8:16 AM

I had a thread that explained why that slow down...

for(var i = 0; i < EquipmentElements.length; i++){
check_and_bind("EquipmentElements["+i+"][EquipmentModelID]", "onchange", page_Equipment_Model_OnChange);
}

for each iteration in that loop, codecharge generated javascript, counts again the elements EquipmentElements.length....
Beside that, in file functions.js there are more examples of that unefficient usage of that kind of loops.

forms_onload(); has that problem too...

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.