Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-30-2007, 09:49 AM   #1
stevo84
Registered User
 
Join Date: Aug 2007
Posts: 1
Default datagrid.getItemAt() - Too Slow Execution

Hello!

I've been stuck with the following problem for several hours. PLEASE HELP

I am using TutFat custom datagrid in my project. I've to style it reffering to certain conditions. Datagrid contains about 57 lines.

PHP Code:

CELL_COLOURING_BY_PARAM 
= new Array(); //this is the condition for colouring text
CELL_COLOURING_BY_PARAM.push({ColumnName:"Status"CellValue:"solgt"});
CELL_COLOURING_BY_PARAM.push({ColumnName:"Status"CellValue:"reservert"});


for (var 
color_cell in CELL_COLOURING_BY_PARAM
{
    
val CELL_COLOURING_BY_PARAM[color_cell].CellValue.toLowerCase()
    
cn CELL_COLOURING_BY_PARAM[color_cell].ColumnName;
    
ci products_dg.getColumnIndex(cn)
    
        var 
= new CodeTimer("----Cell colouring time consumption-----");
    
        for (var 
i:Number=0i<products_dg.lengthi++) 
    {
        if (
products_dg.getItemAt(i)[cn].toLowerCase() == val
        
products_dg.setCellStyle(ici"textcolor"0xFF0000);
    }
    
t.trace();

Execution times oscilate around 1000ms and rise every time i call this piece of code. Whe i remove the condition in loop, exec times reduce drastically, so I presume that getItemAt() is the bottle neck here. I need help!!! There are a few this kind of loops in my code so sometimes it takes 10s to sort grid (and restyle it afterwards)...
stevo84 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Order of method execution in custom components?? PowerfulWebsites Components 2 11-15-2006 09:35 PM
Execution Scope Tutorial astgtciv ActionScript 2.0 8 01-09-2006 01:23 PM
Extremely slow amfphp db execution clem_c_rock Flash Remoting 0 05-06-2004 01:44 PM
slow amfphp execution code clem_c_rock Flash Remoting 9 05-06-2004 09:44 AM
really slow speed on PIII when using ext. swfs FarFeTTu ActionScript 1.0 (and below) 3 10-29-2003 04:23 PM


All times are GMT. The time now is 09:39 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.