Question of selection with editable Spark DataGrid

Hello world

I'm evaluating new Spark DataGrid and I am having a very strange problem with the selection behavior in an editable instance.

Here is my test application: http://www.playcalliope.com/flex/DataGridSelectionIssue.html (code here: https://gist.github.com/1129160)

And here are the steps to reproduce the problem:

  1. Select the first cell in the upper left corner of the grid (the one with 'Gabriele');
  2. click it once more, the Editor appears;
  3. now, click on the cell just to the right (the one with "Genta").

You should see that edition ends as he supposed to do, but the selection is placed on the third cell (the one with a 5 in it) on the one you clicked on. Play a bit with the grid, you will see that this is not the only case, but selection really behaves randomly.

I use SDK 4.5.1.21328.

I think that it is a very basic use case... I can't believe that this does not work, what don't get me?

Thank you very much

Gabriele Genta

Message was edited to add the living example

Your race in a bug known, https://bugs.adobe.com/jira/browse/SDK-30088.

The bug will be fixed in the Mega version. To work around the bug, you can create a custom editor and delete the "dataGrid.validateNow ()"; call to DataGridEditor.save ().

Here's how I modified your example to work around the bug:


http://ns.Adobe.com/MXML/2009.
xmlns:s = "library://ns.adobe.com/flex/spark".
xmlns:MX = "library://ns.adobe.com/flex/mx".
minWidth = "955" = "600" minHeight
backgroundColor = "#E7E7E7."
creationComplete = "application1_creationCompleteHandler (event)" > "
   
       
   

   
   
        Import mx.collections.XMLListCollection;
Import mx.events.FlexEvent;
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
testGrid.dataProvider = new XMLListCollection (testData.item);
}
]]>
   

   
   
       
           
               
                    1
                    Gabriele
                    Genta
                    5
                    molto
               

               
                    10
                    Weill
                    Pallino
                    10
                    poco
               

           

       

       
       
           
               
                    Import mx.collections.ICollectionView;
Import mx.collections.ISort;
                       
public void save (): Boolean
{
If (! validate())

Returns false;
                           
newData:Object var = value;
var property: String = column.dataField;
Object: data var = data;
var typeInfo:String = "";
for each (var variable: XML in describeType (data) .variable)
{
If (property == [email protected] ())
{
typeInfo = [email protected] ();
break;
}
}
                           
If (typeInfo is "String")
{
If (!) (newData) is String))
newData = newData.toString ();
}
ElseIf (typeInfo == 'As')
{
If (!) () newData is uint))
newData = uint (newData);
}
ElseIf (typeInfo == 'int')
{
If (!) (newData) is int))
newData = int (newData);
}
ElseIf (typeInfo == "Number")
{
If (!) (newData) is number))
newData = Number (newData);
}
ElseIf (typeInfo == "Boolean")
{
If (!) (newData) is Boolean))
{
var strNewData:String = newData.toString ();
If (strNewData)
{
newData = (strNewData.toLowerCase () == 'true')? true: false;
}
}
}
                           
If (property & data [property]! == newData)
{
If the data is sorted, disable sorting for published data.
var sort: ISort = null;
If (dataGrid.dataProvider ICollectionView)
{
var dataProvider:ICollectionView = ICollectionView (dataGrid.dataProvider);
If (dataProvider.sort)
{
type = dataProvider.sort;
dataProvider.sort = null;
}
}
                               
var oldData:Object = data [well];
data [property] = newData;
dataGrid.dataProvider.itemUpdated (data, property, oldData, newData);
                               
Restoration of the kind. The data will be not sorted due to this change.
If (out)
. Fate ICollectionView (dataGrid.dataProvider) = classification;
}
                           
Returns true;
}
]]>
                               
           
           
       
   
   
   
Editable = "true" selectionMode = "single-cell".
itemEditor = "{ClassFactory (MyDefaultEditor) new}" >
       
           
               
               
               
               
           

       

   

Tags: Flex

Similar Questions

  • Play with the spark datagrid

    I play with the spark datagrid and I have a column implemented as follows:

    "< GridColumn width ="140"headerText ="Margin"headerText.editMode =" Margin (montage) "dataField ="margin"editable ="false"editable.editMode =" true "itemRenderer ="gridColumnRenderer">
    < / GridColumn >

    I would like that the rendering of the element to change color depending on the State of the outerDocuent, is it possible?

    I tried this but can't seem to the outerdocument

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:fx s:ItemRenderer ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx".
    autoDrawBackground = "true" >

    < s:Label text = "{data .margin}" backgroundColor = "{outerDocument.currentState == 'editMode'? 0xffffff:0xdddddd}" / > "

    < / s:ItemRenderer >

    I believe that you should not use GridItemRenderer instead of ItemRenderer as base class for renderers in spark DataGrid.  It works if you change that?

  • Change the color of the selected TEXT to line Spark DataGrid

    Hello

    Does anyone know of a way to change the color of the text of the selected line in a spark DataGrid? I am able to change the color of flipping, etc, but can't seem to find a way to change the color of the text.

    Let's say the default value is black for all lines. I want to make the color of the text of the line selected, for example, red. Ideas through CSS or Skinning?

    Thank you

    Victor

    I think you need to create a custom item Renderer.

    If you use FlashBuilder, just ask to a default one for you and look at the code.

    I wil put a code here, but everything will be guess I can't check my answer just now. So what I write may be incorrect. I'll look again to change you

    NOTE PLEASE. WHAT CAN BE WRONG. I JUST TRIED TO REMEMBER OFF THE TOP OF MY HEAD!

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx".

    clipAndEnableScrolling = 'true '.

    override public function discard(willBeRecycled:Boolean):void

    {

    Super.Discard (willBeRecycled);

    }

    override public function prepare(hasBeenRecycled:Boolean):void

    {

    if(Data && Selected)

    {

    lblData.setStyle ("color", 0xffff00);

    Search for the 'format' function

    If (column.labelFunction! = null)

    {

    lblData.text = column.labelFunction (data, column);

    }

    on the other

    {

    lblData.text = data [column.dataField];

    }

    }

    Super.Prepare (hasBeenRecycled);

    }

    ]]>

  • Questions about Spark DataGrid (header font Styles, gradient header)

    Just starting in 4.5 SDK and just a little confused on the Spark DataGrid.

    (1) to set the font style for only the head, but do not see these properties in the designer... as they seem to apply to each part of the data grid.

    (2) want to set a linear gradient in the header using two specific colors, alphas, and ratios.  Don't know where to put it now.

    I think that's all for now.  What I did with it up to now, I love... but obviously not as many as MX DataGrid user documentation.

    Thanks in advance!

    Bill

    You can do a column header converters by setting the property of the column. But if you want to exchange all the headers, the header is rendered must be specified in the skin. A trick you can do is subclass the Datagridskin and replace the declaration of 'his '. It also works with other parts of the skin.

    
    
    
        
    
            
            
                
            
    
        
    
    
    

    -Kevin

  • Spark DataGrid edit

    Hello

    I find them to be allocated and cannot find a way to make the Spark DataGrid editable for the user input.

    Is it possible at all, or do I have to use MX DataGrid?

    Thank you

    This is my code to the editable DataGrid control:

    
                             
                                  
                                       
                                            
                                                 
                                                      
                                                           
                                                                
                                                           
                                                      
                                                 
                                            
                                       
                                       
                                            
                                                 
                                                      
                                                           
                                                                
                                                           
                                                      
                                                 
                                            
                                       
                                       
                                            
                                                 
                                                      
                                                           
                                                                
                                                           
                                                           
                                                      
                                                 
                                            
                                       
                                       
                                            
                                                 
                                                      
                                                           
                                                                
                                                           
                                                           
                                                           
                                                      
                                                 
                                            
                                            
                                                 
                                                      
                                                           
                                                           
                                                      
                                                 
                                            
                                       
                                  
                             
                        
    
  • Photoshop: image becomes black when you try to select with inclusive

    image becomes black when you try to select with inclusive

    (edited)

    Powering the OpenGL in the Performance preference and restarting Photoshop have no bearing on the question?

  • Spark datagrid GridItemRenderer cannot access a property or method of a null object reference

    Hello

    I created a spark datagrid with a griditemrender, but when my application startup and the dataprovider is null and have not given.

    At the error

    "Cannot access a property or a method of a null object reference.

    When have given do not have problem

    I was used to the griditemrender:

    prepare method, creationComplete, updateComplete, and all have the same aplication error begins

    any idea of this error?

    +++ My itemrender +++

    <? XML version = "1.0" encoding = "utf-8"? >

    " < = xmlns:fx s:GridItemRenderer ' http://ns.Adobe.com/MXML/2009 "

    xmlns:s = "library://ns.adobe.com/flex/spark" >

    < fx:Script >

    <! [CDATA]

    override public function prepare(hasBeenRecycled:Boolean):void

    {

    valueDisplay.selected = data [column.dataField] as Boolean;

    }

    []] >

    < / fx:Script >

    < s:CheckBox id = "valueDisplay" / >

    < / s:GridItemRenderer >

    Maybe you can try a preliminary validation before the award of 'data '.

    Of

    valueDisplay.selected = data[column.dataField] as Boolean;
    

    TO:

    if(data)
    {
        valueDisplay.selected = data[column.dataField] as Boolean;
    }
    

    I would like to know if it works.

    Best regards

    Pablo Souza

  • Can we synchronize permission selected with the settings of operating system Notifications BB10 for our Application.

    Steps to follow:
    BB10 device--> settings--> Notifications--> Applications--> [name of your application]--> all alerts [Toggle button]

    I have an obligation to check whether or not 'All alerts' is allowed through settings when the application is running. To check if we can synchronize permission selected with the settings of operating system Notifications BB10 for my application. How to get javascript code if alerts permission is on / off, while the application is running.

    I tried adding the blackberry.system function and tried to hasPermission (blackberry.push) also, I can't determine if permission is allow / prohibit... Please suggest how to get that.

    I don't see a WebWorks API for this. If I expected to be anywhere, it's here:
    https://developer.BlackBerry.com/HTML5/APIs/beta/BlackBerry.notification.html#jbo1385148829097

    But it seems that this API has not been fully implemented; It may be useful to connect a developer Issue Tracker JIRA to get this feature added.

    At the same time, there is this API of Cascades that looks like what you're looking for:
    https://developer.BlackBerry.com/native/reference/Cascades/bb__platform__notificationapplicationsett...

    Write an extension for this feature should allow you to access this feature:
    https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10-Cordova/template

    At the same time, a colleague is currently working on an extension that should open many features of Qt, and I think that the API above should be accessible through this extension. He must be released over the next week or two, so you can wait for that as well.

    EDIT: On this last point, see this extension which provides a mechanism for attaching in the majority of the Qt APIs.

    https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10-Cordova/QtBridge

  • I need a box multi select drop-down list or list of selection with image or icon faclitliy

    Hello

    I tried to find a plugin or a jquery plugin that allows to perform the task of

    have a list of selection with images and there should be a facility such as multi select.

    How this can be accomplished. One have they implemented it in any of their application

    Any information will be greatly appreciated.

    Thank you

    pauljohny100 wrote:

    Hello

    I tried to find a plugin or a jquery plugin that allows to perform the task of

    have a list of selection with images and there should be a facility such as multi select.

    How this can be accomplished. One have they implemented it in any of their application

    Any information will be greatly appreciated.

    When ask questions user interface-related still State (at least) the full version of APEX, the theme and the version of browser compatibility / required.

    See the plugin jQuery Select2 , for which there is a plug in APEX .

    Pre-plugin when we have implemented requirements like this using a model report, CSS and personal...

  • How can I send a document by e-mail in PDF with editable fields, drop-down boxes and check boxes?

    Our company uses Adobe Reader as well as the version where send you it for signature, convert to word, excel etc.

    What we are trying to do, however, is create the PDF document, save it to our readers of local network for use in a format PDF with editable fields, drop-down boxes to select and check boxes.

    Can you help me please?

    See you soon

    Lucinda

    Hi lucindab50782713,

    Yes, you can save the document as a model using eSign service create a library template | services eSign so that it can be reused.

    Kind regards
    Nicos

  • Multiple selection with binding variable error

    Hello world

    I tried to put in place an array of adf multiple selection with another table, by following the tutorial (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/75-multi-parent-row-detail-views-328078.pdf), page 3.

    I created all things and first of all I had an exception error, which I fixed, but now, whenever I try to select multiple lines, it won't update the table of the adf.

    In this example, I choose a service line and it shows the emplooyes, but every time I try to choose another line by ctrl clicking on it, the employees table be updated.

    Since I tryied to follow the tutorial, I'll put the code for the bean, I created for this purpose (it's a little different than the code given by the tutorial, but only because I had to get rid of the exception error)

    I use jdeveloper Studio Edition Version 12.1.2.0.0.

    Here is my code for the bean.java:

    Select listen port defined for the departments table. The selected line keys are read in the reference table.

    For each line, the Department ID value is read and added to a string buffer that generates a comma-delimited

    List of the departmentIds. In the end, this string is passed as an argument to the link of action ExecuteWithParams

    {} public void onDepartmentTableSelect (SelectionEvent selectionEvent)

    variable to hold the string containing the selected set value line departmentId

    StringBuffer departmentIds = new StringBuffer();

    Go to the main table to read selected line keys

    RicheTableau rt = selectionEvent.getSource ((richeTableau));

    RKS RowKeySet = rt.getSelectedRowKeys ();

    Iterator selectedRowsIterator = rks.iterator ();

    memorize the current line to place it back in the end key

    CurrentRowKey () rt.getRowKey = (list);

    for each selected master line, determine the departmentId

    int size = 0;

    {while (selectedRowsIterator.hasNext ())}

    size ++;

    The rowKey () selectedRowsIterator.next = (list);

    each value is terminated by a comma

    If (departmentIds.length () > 0) {}

    departmentIds.append(",");

    }

    take the current line

    rt.setRowKey (rowKey);

    JUCtrlHierNodeBinding wrappedRow = rt.getRowData ((JUCtrlHierNodeBinding));

    Line rw = wrappedRow.getRow ();

    /*

    Number departmentId = (number) rw.getAttribute ("DepartmentId");

    */

    int departmentIdInt = rw.getAttribute ("DepartmentId") (Integer);

    oracle.jbo.domain.Number departmentId = new oracle.jbo.domain.Number (departmentIdInt);

    departmentIds.append (departmentId.stringValue ());

    }

    back the foreign currency on the line

    rt.setRowKey (currentRowKey);

    Run the query on the detail table

    BindingContext bctx = BindingContext.getCurrent ();

    BindingContainer links = bctx.getCurrentBindingsEntry ();

    OperationBinding executeWithParams = bindings.getOperationBinding("ExecuteWithParams");

    executeWithParams.getParamsMap () .put ("departmentIds", departmentIds.toString ());

    executeWithParams.execute ();

    refresh the detail table

    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance ();

    adfFacesContext.addPartialTarget (employeeTable);

    }

    }

    If someone has an idea of why it isn't updated table, please answer. Any idea can help.

    Thanks in advance.

    Greetings,

    Frederico Barracha.

    Finally, I found the problem...

    The problem was that I had to remove a line in the properties of my table, the property services: selectedrowkeys, because he only spent the last selected row.

    Yet, I apreciate the help and I had to replace a code in the bean.java, in reason of the exception error and you had to do. Maybe I did a configuration in the wrong way and he would not.

    Thanks for the help.

    Kind regards

    Frederico.

  • questions about dps professional edition

    Hi, I would like to make you a few questions.

    I develop a digital magazine for a client, and I have to carry a magazine of Pentecost one release every 3 months.
    So I would like to know if it's better for me is a professional monthly or annual edition.
    That means, for the monthly professional edition, 250 folio download a year? And many consider each magazine version or just one? (I want to say, 250 download for each new magazine version 4 per year)

    If I download the version number 251, what will happen?

    Another question, if I subscribe monthly edition, the version number 3, will disappear after the month I paid?

    Thank you and sorry for the bad English!
    Andrea

    For examples of simple editing, you can take a look at Adidas Outdoor, for professional, take a look at loop Magazine, Magazine etc. blades. The diferrence major that you will notice is that with editions Professional, Apps have the ability to post multiple questions in an application, so it didn't need to introduce the new application to Apple and get it approved, whenever you have a new version of the question, with simple editing on the other end, each issue would be built in app, and whenever there is a new question/version will be submitted to Apple for review. Also with Professional Edition, you have an option to publish on the kiosk, Amazon, Android, iPhone. While the only edition is currently only available for the iPad.

    Thus, according to your priorities, decide that for yourself.

  • Cannot see the data of the model within inline ItemRenderer in Spark DataGrid

    I'm having a problem displaying the model data in an ItemRenderer, online in a Spark DataGrid

    Here is the code for the DataGrid control

    < s:DataGrid id = "moduleDG" includeIn = "HomeRequired" x = "20" y = "116" width = "764" height = "404".

    " click =" DGchangeHandler (event) "dataProvider =" {model.items} ">

    < s:columns >

    < s:ArrayList >

    < s:GridColumn id = "myModuleName" dataField = "moduleName" headerText = "{model.ui_nameColumn_str}" / > "

    < s:GridColumn id = "myEnterColumn" dataField = headerText = "{model.ui_actionColumn_str"launchActionText"}" >

    < s:itemRenderer >

    < fx:Component >

    < s:GridItemRenderer >

    < s:Button label = "{parentDocument.model.ui_nameColumn_str}" / > "

    < / s:GridItemRenderer >

    < / fx:Component >

    < / s:itemRenderer >

    < / s:GridColumn >

    < / s:ArrayList >

    < / s:columns >

    < / s:DataGrid >

    In the "inline" without the parentDocument reference ItemRendered, I get an 1120: access of undefined property error model. If I use outerDocument I get 1178: any attempt to access the property model inaccessible through a reference with static type error. I don't know what I should use here...

    The next column has no difficulty to display the property of model.ui_nameColumn_str - I understand the issue around scope and view the correct instance, I don't know how to get the model of the inline ItemRenderer. (We use simplemvc)

    Thank you

    Model must be a public variable, then outerDocument should work.

  • Question about Threads with WHILE and FOR

    Hi all

    I have a question on threads with a loop on this topic sentece.

    Have the following class:
    class test{
    
    bool foundThing;
    PararellSearch(string [] lista, string s2find){
    while(!foundThing)
    {
    for(int i=0;i<lista.length;i++){
    if(s2find==lista){
    foundThing = true;
    break;
    }
    }
    }
    }
    If I start 10 threads which are using the PararellSearch method to look into lista, each of them inits into a different point, and when some of them found the right word then set foundThing= true. It will stop WHILE and FOR loop in all the threads? 
    If not, how could I do it?
    
    Thanks a lot for your help.
    David.
    
    Edited by: user13553506 on 27-dic-2010 12:15
    
    Edited by: user13553506 on 27-dic-2010 15:54                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    When you post the code, you'll want to post a [url http://sscce.org] NBS so that it is clear that what you try to do it. For example:

    1. in the validation of code, put {code} before and after him, then he will be readable.

    2. the convention in Java must start with a capital letter class names, so test, could not test.

    3. the convention in Java is to start with lowercase letters, so parallelSearch, not PWhateverMisspellingYouHaveThere method names.

    4. There is no such thing as bool. It is a Boolean.

    5. it is a String, not string.

    6. never use == to compare the States of objects (such as the content of the strings). Use equals().

    To answer your question: If you create Test 10 objects, then, given that foundThing is an instance variable, there will be 10 variables entirely independent foundThing. An adjustment will not affect the other. In this case, the easiest thing to do would be to foundThing static, so that there is only one copy which is shared by the Test class as a whole. This isn't the only way, or even the best way in all cases, but you have enough other problems to face, so for now to keep things simple.

    Finally, when you have a variable that is shared by multiple threads, you need to either make all the access to this variable synchronized on the same lock (reads and writes), or you need to declare the volatile variable.

  • Spark Datagrid columnheader click

    Hello!

    With the next Eventlistener I can detect a click on the Spark Datagrid header.

    dg.sortableColumns = false;
    dg.columnHeaderGroup.addEventListener (MouseEvent.CLICK, headerClickListener);
    ……………..
    Event handler header
    private void headerClickListener(event:MouseEvent):void {}
    Alert.Show ("something");

    But how do I detect the current column of the user clicked Headeritem?

    In my view a Build-In Header-Click-event and a Build-In Columnlocking is a "Must Have" of a professional Datagrid.

    Will there be a Flexupdate with a Datagrid improved spark in next time?

    Greetings

    Uwe

    Instead of listening for the GridEvent.GRID_CLICK event. The GridEvent will be the index of the column in it. We return all the events of the mouse on the DataGrid as GridEvents.

    -Kevin

Maybe you are looking for

  • Mozilla plugin checker stops with the error msg; Impossible to update to Acrobat, Shockwave Flash, Java, Metastream.

    Desktop computer running XP Media Center, Firefox 18.0.1. Acrobat plugin 7.0.0.0 generating warnings, suggests the necessary update. Shockwave Flash 10.1.85.3 is vulerable and needs updating. Java SE 7 U 4 is vulnerable and has been disabled and atte

  • E-mail crashes on ios 9.2.1

    I have updated IOS to 9.2.1 on my iphone 4S.  Main problem at this point (there were others), it's that the mail app crashes.  I did a hard reset several times, have disabled by e-mail when you reset and then turned the e-mail back, deleted the email

  • Satellite Pro L40 - cannot install Windows XP

    Material: Satellite Pro L40, HDD 80 GB, 1.5 GB of RAM Software: Windows XP + SP2 install CD, floppy disk with AHCI HDD ICH8M_32bit drivers drivers created according to the instructions in "how to install Windows XP on a L40.pd"f of Toshiba (which is

  • Cannot find Write.vi AO

    When I opened the source code 8.0 LV in 2010 LV, LV is AO Write.vi.  I have loaded NOR-DAQ traditional 7.4.4 drivers but I see NEITHER-traditional DAQ in my palette measure IO.  Any ideas?  LV 2010 support NOR-traditional DAQ? Thanks in advance.

  • Low flow on mentioned

    Just bought a WRT1900AC router to replace a unit of Netgear.  Have 2 EX6100 of Netgear extenders that connect but do not have very good productivity with new router. SpeedTest on router - 25mbps downloand, 6.9mbps download.  The two Extenders were 3.