History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-15568
Type: Bug Bug
Status: Internal Review Internal Review
Priority: None None
Assignee: Robert Vollmar
Reporter: Carlos Molina
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Flex SDK

If there are locked columns, DG is editable, and part of the last column is showing, infinite loop occurs when giving focus to the last column.

Created: 05/14/08 02:47 PM   Updated: 06/24/08 07:34 PM
Component/s: mx: DataGrid
Security Level: Public (All JIRA Users )

File Attachments: 1. Text File DataGrid.as (181 kb)
2. File datagridtest.mxml (4 kb)


Severity: Crash/Hang
Reproducibility: Every Time
Discoverability: Medium
Found in Version: SDK Flex 3 (Released)
Affected OS(s): Windows - All Windows
Steps to Reproduce:
Attached is a simple app that will demonstrate the issue

Steps to reproduce with example:

When you run the example, there should be a horizontal scrollbar at the bottom of the table.
Click on a cell in the middle of the table.
Press the tab key to advance to the next cell.
When you get to a point where you are tabbing to a cell that requires the horizontal scrollbar to shift, the infinite loop occurs.
If the bug were not present, you should be able to continue tabbing to the end of the row and then continue tabbing through cells in the next row.


I believe I have discovered a fix for this issue within the Flex DataGrid.as file, however, it is in a private method.

I was able to try out the fix by creating copies of DataGrid.as, DataGridItemRenderer.as and DataGridHeader.as, giving them new names and updating references.

Here is the proposed fix in DataGrid.as. It is in the scrollToEditedItem method:



<original code>

:

    while (colIndex > lastColIndex ||

          (colIndex == lastColIndex && colIndex > horizontalScrollPosition + lockedColumnCount &&

           partialCol))

    {

        if (horizontalScrollPosition == maxHorizontalScrollPosition)

            break;

        horizontalScrollPosition = Math.min(horizontalScrollPosition + (colIndex > lastColIndex ? colIndex - lastColIndex : partialCol), maxHorizontalScrollPosition);

        len = (listItems && listItems[0]) ? listItems[0].length : visibleColumns.length;

        lastColIndex = horizontalScrollPosition + len - 1 + lockedColumnCount;

        partialCol = (listItems[0][len - 1].x + listItems[0][len - 1].width > listContent.width) ? 1 : 0;

    }

:





<code with fix>

:

   var horzScrollPos:Number = horizontalScrollPosition;

   while (colIndex > lastColIndex ||

         (colIndex == lastColIndex && colIndex > horizontalScrollPosition + lockedColumnCount &&

          partialCol))

   {

       if (horzScrollPos == maxHorizontalScrollPosition)

           break;

       horzScrollPos = Math.min(horzScrollPos + (colIndex > lastColIndex ? colIndex - lastColIndex : partialCol), maxHorizontalScrollPosition);

       len = (listItems && listItems[0]) ? listItems[0].length : visibleColumns.length;

       lastColIndex = horzScrollPos + len - 1 + lockedColumnCount;

       partialCol = (listItems[0][len - 1].x + listItems[0][len - 1].width > listContent.width) ? 1 : 0;

   }

   horizontalScrollPosition = horzScrollPos;

 
 
 
Language Found: English
Bugbase Id: none
Triaged: Yes
Regression: No
QA Owner: Robert Vollmar
Participants: Carlos Molina and Robert Vollmar
Browser: Internet Explorer 7.x


 All   Comments      Sort Order:
Robert Vollmar - [05/19/08 02:33 PM ]
Able to reproduce in 3.0.1 and gumbo-fp10 revision 1782. Changing the summary. The problem is that when there are locked columns and part of the last column is visible, tabbing to the last column (or cliking on it) will cause an infinite loop and eventually the RTE below. Note that it works ok if all of the last column is showing before trying to give it focus.

Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
at mx.core::UITextField/set ignorePadding()
at mx.controls.dataGridClasses::DataGridItemRenderer()
at mx.core::ClassFactory/newInstance()
at mx.core::ContextualClassFactory/newInstance()
at mx.controls.dataGridClasses::DataGridBase/createColumnItemRenderer()
at mx.controls.dataGridClasses::DataGridHeader/updateDisplayList()
at mx.core::UIComponent/validateDisplayList()
at mx.managers::LayoutManager/validateClient()
at mx.core::UIComponent/validateNow()
at mx.controls::DataGrid/set horizontalScrollPosition()
at mx.controls::DataGrid/scrollToEditedItem()
at mx.controls::DataGrid/commitEditedItemPosition()
at mx.controls::DataGrid/updateDisplayList()
at mx.controls.listClasses::ListBase/validateDisplayList()
at mx.managers::LayoutManager/validateDisplayList()
at mx.managers::LayoutManager/doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()
at mx.core::UIComponent/callLaterDispatcher()


Robert Vollmar - [06/24/08 07:34 PM ]
Fix for 3.0.x