Adobe Dreamweaver Forums



Last 10 THreads :         Re: sRGB vs. Adobe (1998) RGB (Last Post : Ramón_G_Castañeda@adobeforums.com - Replies : 0 - Views : 1 )           »          Re: sRGB vs. Adobe (1998) RGB (Last Post : Ramón_G_Castañeda@adobeforums.com - Replies : 0 - Views : 1 )           »          Re: Optimal Scratch Disk (Last Post : Lundberg02@adobeforums.com - Replies : 0 - Views : 1 )           »          Re: ColorSync Sucks (Last Post : Lundberg02@adobeforums.com - Replies : 0 - Views : 1 )           »          help me with adjustments layers in CS4 (Last Post : Ann_Shelbourne@adobeforums.com - Replies : 2 - Views : 3 )           »          "Save As" crashes PS (Last Post : Rothrock@adobeforums.com - Replies : 2 - Views : 3 )           »          Flash Slide presentation and movieclip looping (Last Post : pivovar - Replies : 0 - Views : 1 )           »          Array of Queries (Last Post : Fetch - Replies : 5 - Views : 6 )           »          Re: 2.1 GB TIF size limit (Last Post : Buko - Replies : 0 - Views : 1 )           »          Re: Colour differences on the web (Last Post : Ann_Shelbourne@adobeforums.com - Replies : 0 - Views : 1 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-04-2008, 09:00 AM
ntsiii
 
Posts: n/a
Diggs:
Default Re: Programmatically tell itemEditor to begin edit

Not tried with tree but with DG you can call editedItemPosition().

Tracy


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-04-2008, 09:00 AM
savyasachi
 
Posts: n/a
Diggs:
Default Re: Programmatically tell itemEditor to begin edit

Thanks Tracy. That helped. Now I am able to enable item editor for the first
cell of a new row in the grid when the "add new" button is clicked.

However I ran into another issue. I am also trying to add a new row to the
Grid and enable item editor for the first cell of the new row, if the user tabs
out of the last cell of the previous row. I am calling the editedItemPosition()
in DataGridEventReason.NEW_ROW and also DataGridEventReason.OTHER in the
itemEditEnd handler for the Grid, but it is not working. When I tab out of the
last filled row of the Grid, focus is going out of the Grid and to the address
bar of the browser and when I tab again it comes to the last cell of the last
row and then the next tab is taking me to the first cell of the new row and
then item editor gets activated this time. Not sure what I am missing.
Appreciate if you can let me know what I am missing here.

Attached the code.


private var bLastCellOut:Boolean = false;

//if the user tabbed out of the last cell of the last row
//then add a new row and activate the itemEditor for the first cell
//in the next row...
private function editEnd(eventataGridEvent):void
{
var item:BacklogItem = backlogsAr[event.rowIndex];
var errMsg:String = "";
var value:String = TextInput(event.currentTarget.itemEditorInstance). text;
TextInput(event.currentTarget.itemEditorInstance). errorString = errMsg;

//User trying to enter to a new column in the same row
//Validate the data in the current column and prevent it if the validation
fails...
if(event.reason == DataGridEventReason.NEW_COLUMN)
{
bLastCellOut = false;
errMsg = item.ValidateDataInput(event.dataField, value);
if(errMsg != "")
{
event.preventDefault();

TextInput(event.currentTarget.itemEditorInstance). errorString =
errMsg;
}
}
else
{
//User trying to enter to a new row
//Validate the data in the current column and prevent it if the validation
fails...
//If the validation is successful, create the new empty row in the Grid
if(event.reason == DataGridEventReason.NEW_ROW)
{
errMsg = item.ValidateDataInput(event.dataField, value);

if(event.rowIndex == (backlogsAr.length - 1))
{
if(errMsg != "")
{
event.preventDefault();

TextInput(event.currentTarget.itemEditorInstance). errorString =
errMsg;
}
else
{
bLastCellOut = true;
//Alert.show("Adding the new Row...");
addNewRow();
}
}
}
else
{
//User is trying focus out of this control, remove the empty rows if
exists...
if(event.reason == DataGridEventReason.OTHER)
{
//Alert.show("Leaving the control...");
if(bLastCellOut == true)
{
bLastCellOut = false;
bklogsGrid.setFocus();
event.preventDefault();
setEditPosition();
}
//addNewRow();
}
}
}

}

private function addNewRow():void
{
var obj:BacklogItem = new BacklogItem();
backlogsAr.addItemAt(obj, backlogsAr.length);

setEditPosition();
}

}

private function setEditPosition():void
{
if(backlogsAr.length > 0)
{
var newRowPos:Object = new Object();
newRowPos.columnIndex = 0;
newRowPos.rowIndex = backlogsAr.length-1;

bklogsGrid.editedItemPosition = newRowPos;
}
}

Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 11:47 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk