DataGrid Sort Clears HeaderRenderer Checkbox

I have a datagrid that I defined a checkbox as the
headerrenderer for one of the columns. It took me a while to track
this down, but it seems like a re-sort on one of the columns (other
than the checkbox headerrenderer column) clears the state of the
checkbox and resets it to chexkbox.selected=false.
Is there any way to persist the checkbox selected property of
a headerrenderer checkbox instance on re-sort.
I played with disabling the default sort methods and creating
my own sort functionality by only allowing a specific column to be
sorted. That didn't solve my problem though.
Thanks,
JB

I did something similar with my DataGrid. The way I solved
the problem was to make a global variable to hold the checkBox's
checked value and then on the checkbox's click event ran a global
function to handle the setting of the global var:
<mx:DataGridColumn id="copyColumn" dataField="check"
width="35">
<mx:headerRenderer>
<mx:Component>
<mx:HBox horizontalAlign="center"
verticalAlign="middle">
<mx:CheckBox id="check"
tabIndex="1" labelPlacement="top" selected="
{outerDocument.check_flg}"
click="
outerDocument.checkAll(check.selected)" height="18" />
</mx:HBox>
</mx:Component>
</mx:headerRenderer>
</mx:DataGridColumn>
note that the above code is contained in a component that
extends mx:DataGrid
I think you can get the jist...

Similar Messages

  • DataGrid sort start/completion:  specific associated events?

    Hi all,
    A lot of my DataGrid sorts take a non-trivial amount of time.
    So, I'd like to show a busy cursor while the operation runs. In
    order to do this I'd need events associated with the start and
    completion of the operation. Are there such events available?
    Thanks!
    -Noah

    This thread was "imported" from the old forums -- most, if not all, code seems to have disappeared. But here are the sort functions I posted:
    function sortXML(source:XML, elementName:Object, fieldName:Object,
    options:Object = null):XML
         // list of elements we're going to sort
         var list:XMLList=source.elements("*").(name()==elementName);
         // list of elements not included in the sort -
         // we place these back into the source node at the end
         var excludeList:XMLList=source.elements("*").(name()!=elementName);
         list= sortXMLList(list,fieldName,options);
         list += excludeList;
         source.setChildren(list);
         return source;
    function sortXMLList(list:XMLList, fieldName:Object, options:Object =
    null):XMLList
         var arr:Array = new Array();
         var ch:XML;
         for each(ch in list)
               arr.push(ch);
         var resultArr:Array = fieldName==null ?
               options==null ? arr.sort() :arr.sort(options)
               : arr.sortOn(fieldName, options);
         var result:XMLList = new XMLList();
         for(var i:int=0; i<resultArr.length; i++)
               result += resultArr[i];
         return result;

  • Datagrid sorting issues with 1/0 items to consider

    Hi all,
    I have an issue I can't find a way to fix. I am using a datagrid which I pouplate through a XMListCollection based on some XML datas.
    XML:
    var prefs:XML = <files>
    <file name="@toto" favourite="1"/>
    <file name="@toto"favourite="0"/>
    </files>;
    XMLListCollection
    var xlc:XMLListCollection = new XMLListCollection( new XMLList ( prefs.file) );
    MXML
    <mx:DataGrid id="filesList" width="100%" height="100%" dataProvider="{xlc}">
    <mx:columns>
    <mx:DataGridColumn width="25" dataField="@favourite"sortCompareFunction="favourite_sortCompareFunc"/>
    </mx:columns>
    </mx:DataGrid>
    Sorting fucnction:
    private function favourite_sortCompareFunc(itemA:Object, itemB:Object):int {
        var value1:Number = Number( itemA.@favourite );
        var value2:Number = Number( itemB.@favourite );
        if(value1 < value2){
             var n:Number = -1;
             return n;
        else if(value1 > value2){
             return 1;
        else{
             return 0;
        return 1;
    Once loaded, the datagrid appears in a "normal state":
    But if I try to sort first column, it becomes messy
    I think it might be related to the fact that the data to be sorted is only made of 0 & 1. But I can't imagine this kind of situations is not fixable.
    Any hint ?
    Thanks in advance for any advice,
    Loic

    Hi guys,
    First of all, all my apologizes for my silence. I had technical issues with Yahoo mail that made me miss 3 months mail ! So I just missed your posts and I can only come today to thank you all for your care and answers.
    In the meanwhile, I finally got it working by doing…nothing. Let me explain. The issue was caused by equal datas ( 1 or 0 ). So Flex couldn't sort 1 and 1 or 0 and 0 by itself. But these 0 and 1 were flags for an itemrenderer made of a button in toggle mode. 1 standed for on, 0 for off.
    Doing so I did override updateDisplayList and then the issue went away. But if I had to stick with pure datas ( 1 or 0 ) I think I would have had to do a custom sort function to deal with equal datas like a few of you offered.
    @DonMitchinson the @ stands for the xml attribute as the datagrid is populated with XMLListCollection from an XML file.
    Thanks for your sharing,
    Best,
    Loic

  • Clear these Checkboxes​?

    Using a Curve 8900, OS 4.6.1.231
    This question applies to using the BB as a modem via Bluetooth, as well as using the TMobile US (USB) connection created via DTM.
    In the connection properties for each of these, should I check or uncheck any or all of the following:
    Use IP Header Compression
    Enable Hardware Flow Control
    Enable Hardware Compression
    Enable Hardware Error Control
    Negotiate multi-link for single-link connection
    My Bluetooth connection doesn't have any of those boxes ticked (except multi-link), and it works pretty well, yet in the Status dialog I always see "Errors" listed, and the number always increases as the session continues.
    In the USB connection created automatically using Desktop Manager 5.0.1, all those boxes ARE checked off (except multi-link). The connection works, and so far I have not seen any errors at all.
    In the configuration settings, phone and modem options>modem tab>standard modem properties>modem tab, port speed is set to 115200, and in connection properties>connect using>configure, maximum speed (bps) is set to 921600.
    I have checked all over the Internet, and results tend mostly towards clearing all checkboxes, but I am confused, especially since the USB connection was created using DTM's "wizard" and left the "multi-link" option unchecked, but checked IP Header Compression despite the fact that BlackBerry's own advice was to uncheck it.
    I was hoping somebody here could provide the definitive, conclusive answer for this.
    Also, is there any way to increase the speed of the connection to bring it closer to wi-fi speeds? I know this is probably not going to happen, and it's not as important to me as having definite answers to the question above, but it would be nice to know if this can be done.

    Thanks Bobb for all the help :)
    I still have one question:
    What determines the "Related Contacts" ? As I understand the rule assign the record to an owner, so does this checkbox also assign this record to others as owners ?
    *What determines the relationship between contacts, is it the role hierarchy, The user to whom it is reporting to will also be assigned the same record ?* This holds true for Opportunity records too ... that the relationship is determined by the reporting hierarchy ?
    Thanks

  • Datagrid sorting issue

    I have two datagrids. After a form is submitted, datagrid 1
    is populated. Clicking on any of the rows will submit to another
    query and populate datagrid 2.
    If I have submitted my form and datagrid 1 is populated, and
    I sort the columns, it will sort and kick of the second query.
    Instead of sending to the HTTP service directly when clicking
    on datagrid 1 header or row, I have it going to a routine. If the
    user has not selected a row, and clicks a column, it will sort but
    not submit.
    However, that only gets me half the way there. If a user
    selected a row in datagrid 1, and then sorts, it will still submit
    to datagrid 2. Again, I don't see why if I'm clearly clicking on
    the column header to sort that it should submit also.
    Is there a way to make the column header independent of the
    rows?

    I would not have expected that.
    Pass "event" into the itemClick handler.
    Use it to determine what was clicked, and do not make your
    data service call if it is the header row. Not exactly how to
    determine that, you will need to look at the contents of that
    event. Maybe rowIndex = -1?
    Tracy

  • Remove datagrid sort

    Is it possible to remove a sort from a datagrid column? I want to give the user the ability to remove a sort from a column since currently once they sort they can not unsort. Also, if I put new clear the data provider and put new data in the column stays sorted and that is not the preferred functionality.

    Hello Silent Ryan,
    This will clear the sort:
    ListCollectionView(dataGrid.dataProvider).sort = null;
    ListCollectionView(dataGrid.dataProvider).refresh();
    Thanks,
    Philip
    Message was edited by: PhilipKeiter

  • DataGrid Sorting Problem

    Hi all,
    We are running one query from Sql Query Analyser ,
    for selecting values and displaying it in ascending order.
    We are executing the same query from coding to load in to
    datagrid , but its not arranging it by ascending order instead
    its sorting randomly.
    Because of this, if i select particular row from Datagrid, its not fetching
    the selected row from the grid instead its taking corresponding row number's
    value.
    Thanks
    Vaithy

    HI  vaitheeswaran l...    ,
    yeah what u said is correct grid takes in that manner when u are using collapse levels.try without using collapse levels.if u want using collapse levels it wont come
    Edited by: micheal willis on Oct 9, 2009 11:34 AM

  • Datagrid column that contains checkbox erroring

    Hi i'm trying to set the selected option on a checkbox in a datagrid column but i keep getting the error "Access to undefined property data".  Can someone shead some light on how i can fix this?  The code i have is below.
    Thanks in advance....
    <mx:DataGrid x="140" y="85" width="596" height="294" id="rankGrid" dataProvider="{dp}" doubleClick="updRank();" doubleClickEnabled="true">
    <mx:columns>
    <mx:DataGridColumn headerText="Court" dataField="court"/>
    <mx:DataGridColumn headerText="Team One" dataField="level"/>
    <mx:DataGridColumn headerText="Checked In" dataField="chkdInOne">
    <mx:itemRenderer>
    <fx:Component>
    <s:CheckBox selected="{data.chkdInOne}" click="outerDocument.checkInTeamOne()" />
    </fx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    <mx:DataGridColumn headerText="Team One" dataField="teamonedesc"/>
    <mx:DataGridColumn headerText="Checked In" dataField="chkdInTwo">
    <mx:itemRenderer>
    <fx:Component>
    <s:CheckBox click="outerDocument.checkInTeamTwo()" selected="{data.chkdInTwo}"/>
    </fx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    <mx:DataGridColumn headerText="Team Two" dataField="teamtwodesc"/>
    </mx:columns>
    </mx:DataGrid>

    try wrapping your component inside the itemrenderer tag
    <fx:Component>
         <s:ItemRenderer>
              <s:CheckBox   />                                   
         </s:ItemRenderer>
    </fx:Component>

  • Can I sort/group by checkbox status?

    My iPod is just about full, but I am always adding new tunes to iTunes for the future. Until I can re-evaluate some of my older stuff and delete it, I am keeping these new tunes off the iPod by unchecking the checkboxes. I also uncheck the check boxes of every tune I have not yet assigned to a playlist, since I haven't yet found a way to tell iTunes "show me everything I have NOT assigned to a playlist."
    Is there any way for me to get all these un-checkmarked items to sort or group together in the giant list of music?
    Thanks to anyone who can answer.

    You might do better to make a playlist with the music you want on your iPod rather than the check boxes. Then you set your iPod to sync to your playlist.
    You could use either a regular playlist or a smart playlist which opens up may intersting possibilites.
    But to answer you question, you can only do this indirectly. You can make a smart playlist that includes only checked items. Then you can make a second smart playlist that lists items not in the first playlist.
    Playlist1
    mach following rule:
    Date added after 01/01/1900 (just there to select everthing)
    Match only checked items checked.
    Live updating checked
    Playlist2
    Match following rule:
    Playlist is not playlist1
    Match only checked items NOT checked
    Live updating checked

  • Datagrid sorting

    Hello,
    I have a problem when it comes to sorting a datagrid with multiple fields. I have two fields A and B . B has numerical values . How can i sort B yet also change the data in A since they are dependent from each other?
    This is my datagrid
    <s:DataGrid id="rankinggrid" includeIn="Ranking" x="156" y="84" width="528" height="229"
                                            dataProvider="{gridrank}" requestedRowCount="4">
                        <s:columns>
                                  <s:ArrayList>
                                            <s:GridColumn dataField="sequrank" headerText="Sequence" sortDescending="true"></s:GridColumn>
                                            <s:GridColumn dataField="coeff" headerText="Coeffiecent"></s:GridColumn>
                                  </s:ArrayList>
                        </s:columns>
                </s:DataGrid>
    Basically i want to sort coeff in desending order but i want to data in seqrank to move accordingly.
    Thanks for your help
    P.s i am managing to populate the datagrid so all i need is to sort it thanks

    Thanks for your help again
    I have reduced the code since the original code is very lengthy and hence impossible to post , yet this should work.
    Here i am sorting the grid array according to cost. The problem is that it doesnt work it out in a descending manner(the command you told me doesnt work it gives me an error ) i have used sort and it sorts it in an ascending way and does not give me an error
    I would like to solve in a descending way Hope you can help thanks for your time i really appreciate
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                                         xmlns:s="library://ns.adobe.com/flex/spark"
                                                         xmlns:mx="library://ns.adobe.com/flex/mx"
                                                         creationComplete="init()"
                                                         width="800" height="600">
              <fx:Declarations>
                        <s:ArrayCollection id="ProcessAdder">
                                  <fx:Object ProcessName ="Milling" Cost ="240" Service_Rate="14"  />
                                  <fx:Object ProcessName ="Lathe" Cost ="975" Service_Rate="9" />
                                  <fx:Object ProcessName ="Boring" Cost ="800" Service_Rate="8" />
                                  <fx:Object ProcessName ="Drilling" Cost ="270" Service_Rate="20"  />
                        </s:ArrayCollection>
              </fx:Declarations>
              <fx:Script>
                        <![CDATA[
                                  import mx.collections.*;
                                  import mx.collections.ArrayCollection;
                                  import mx.collections.Sort;
                                  import mx.collections.SortField;
                                  public function init(){
                                  var mySort:Sort = new Sort();
                                  // Set the sort field; sort on the last name first, first name second.
                                  var sortfieldRank:SortField = new SortField("Cost", Sort); //descendingSort
                                  mySort.fields = [sortfieldRank];
                                  // Apply the sort to the collection.
                                  //gridrank.sort = mySort;
                                  ProcessAdder.sort = mySort;
                                  ProcessAdder.refresh();
                        ]]>
              </fx:Script>
              <mx:Legend dataProvider="{ProcessAdder}"/>
              <mx:DataGrid id="ProssGrid" x="22" y="334" width="715" dataProvider="{ProcessAdder}"
                                            >
                        <mx:columns>
                                  <mx:DataGridColumn dataField="ProcessName" headerText="Process Name"/>
                                  <mx:DataGridColumn dataField="Cost" headerText="Cost"/>
                                  <mx:DataGridColumn dataField="Service_Rate" headerText="Service Rate"/>
                        </mx:columns>
              </mx:DataGrid>
    </s:WindowedApplication>

  • DataGrid Sorting Issue with Hotfix2

    I already opened a ticket with Adobe on this, but since this
    is a critical issue for us I wanted to post a message to see if
    anyone has any idea where the issue in flex sdk lies.
    Check tab 2 of the sample app, Sorting a datagrid who's
    column only has partial data causes an error, works fine on Hotfix
    1 (same test)
    Sample App:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="creationComplete()">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.utils.ObjectProxy;
    [Bindable]
    public var dgData:ArrayCollection = new ArrayCollection();
    public function creationComplete():void
    var object:ObjectProxy;
    object = new ObjectProxy();
    object["filled"] = "Filled A";
    object["partial"] = "Partial A";
    dgData.addItem(object);
    object = new ObjectProxy();
    object["filled"] = "Filled B";
    object["partial"] = "Partial B";
    dgData.addItem(object);
    object = new ObjectProxy();
    object["filled"] = "Filled C";
    dgData.addItem(object);
    object = new ObjectProxy();
    object["filled"] = "Filled D";
    dgData.addItem(object);
    ]]>
    </mx:Script>
    <mx:XMLList id="treeData">
    <node label="Mail Box">
    <node label="Inbox">
    <node label="Marketing"/>
    <node label="Product Management">
    <node label="Large node Large Node Large Node Large
    Node"/>
    </node>
    <node label="Personal"/>
    </node>
    <node label="Outbox">
    <node label="Professional"/>
    <node label="Personal"/>
    </node>
    <node label="Spam"/>
    <node label="Sent"/>
    <node label="Spam2"/>
    <node label="Sent2"/>
    <node label="Spam3"/>
    <node label="Sent3"/>
    <node label="Spam4"/>
    <node label="Sent4"/>
    <node label="Spam5"/>
    <node label="Sent5"/>
    <node label="Spam6"/>
    <node label="Sent6"/>
    </node>
    </mx:XMLList>
    <mx:TabNavigator height="100%" width="1005">
    <mx:Canvas label="Tree Issue">
    <mx:Text x="284" y="51" fontSize="16" fontWeight="bold"
    text="Issue: Expand the tree node to open up Product Management
    node, no Horizontal Scroll bar appears." width="390"/>
    <mx:Canvas verticalScrollPolicy="auto"
    horizontalScrollPolicy="auto">
    <mx:Tree x="50" y="50" width="226" height="303"
    dataProvider="{treeData}" labelField="@label"
    verticalScrollPolicy="auto" horizontalScrollPolicy="auto"/>
    </mx:Canvas>
    </mx:Canvas>
    <mx:Canvas label="DataGrid Issue">
    <mx:DataGrid id="dgTest" dataProvider="{dgData}"
    width="500" height="300" x="10" y="10">
    <mx:columns>
    <mx:DataGridColumn headerText="Filled Row"
    dataField="filled"/>
    <mx:DataGridColumn headerText="Partially Filled Row"
    dataField="partial"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:Text x="10" y="318" fontSize="16" fontWeight="bold"
    text="Issue: Toggle the sort in the column that has only partial
    data. You will get a find criteria error. This worked in Hotfix 2
    and was broke in Hotfix 2." width="390"/>
    </mx:Canvas>
    </mx:TabNavigator>
    </mx:Application>

    Hi,
    With new hotfixes some bugs ( most of bugs) in Flex SDK are
    get fixed, but rarely new (sometimes critical) bugs can appear.
    Before Flex 3 release which will allow on IDE level to switch
    between different versions of Flex SDK on the fly, I would advice
    you to store locallly copy of all versions of Flex 2 SDK released
    to the public. Then, in case if you will encounter a serious bug in
    the most recent release of Flex 2 SDK, you can fix it by yourlself
    by reusing the old code from former release of Flex 2 SDK.
    See what I did with found bug in Flex 2.0.1 release, which is
    what not present in Flex 2.0 SDK release:
    jabbypanda.com/blog/?p=25

  • DataGrid sort efficiency questions

    Hi,
    I guess I have two specific questions:
    1. Is sorting a DataGrid faster/slower/same by applying a
    sortCompareFunction to a specific column vs. applying a Sort object
    directly to the underlying dataprovider?
    2. It says in the following link that if you use a
    labelFunction on a column, you must also use a sortCompareFunction:
    dataGridColumn.sortCompareFunction
    ASDOC
    Is this really true - anyone know why?
    Thanks!
    -Noah

    Alexander,
    In Flex 3 sorting is controlled by the collections rather than the controls. This provides greater flexibility overall despite making it hard to adjust to. To get or set a sort on the DataGrid in Flex 3, use the sort property of its dataProvider:
    ListCollectionView(dataGrid.dataProvider).sort
    You can both read and write to the sort property. When you write to it, you have to call refresh() after for it to apply. Refer to the documentation on the ListCollectionView class for how to properly get and set its sort property.
    Thanks,
    Philip

  • Figuring out datagrid sort programmatically

    OK I've got a datagrid with 4 columns. I'm giving the end
    user the opportunity to sort on any of these columns. They also
    have a report that is generated based on the data in the grid, but
    I'm wondering how determine on which column the grid is sorted, and
    which (ascending / descending) order so that I can sort the report
    in that exact same manner.
    I've added some code on the headerRelease event to track this
    information (storing it in the Cairngorm ModelLocator), but if you
    trace the results it doesn't foot to what you're actually doing,
    for example the following writes inconsistent (to the apparent
    action being taken in the interface) info to the console. I can
    always get the correct dataField property, but its sortDescending
    property is almost always opposite of what the datagrid displays:
    private function
    handleHeaderRelease(dgEvent:DataGridEvent):void
    for(var k:int=0;k<myGrid.columns.length;k++)
    trace(myGrid.columns[k].dataField + ":" +
    myGrid.columns[k].sortDescending);
    trace("");
    Does anyone know of a better way to figure out on which
    column the grid is currently sorted, and what sort nature is
    currently applied?
    TIA,
    Joe

    OK I figured this out after remembering that the dataprovider
    of the datagrid is just an ArrayCollection - here's the answer for
    anyone who's looking for the same thing.
    In the function that calls the report:
    var s:Sort;
    var sF:SortField;
    s = summaryGrid.dataProvider.sort;
    // if sort is null, they haven't clicked any column headers,
    so use the default
    if(s == null)
    urlVariables.sortOrder = "dtAdded";
    urlVariables.sortNature = "DESC";
    otherwise use the first sort field
    (this could be modified to build an appropriate order by
    statement for multiple
    sort fields if necessary)
    else
    sF = s.fields[0];
    urlVariables.sortOrder = sF.name;
    urlVariables.sortNature = sF.descending?"DESC":"ASC";
    Hope this helps someone!

  • DataGrid selection indicate by CheckBoxes

    My custom DataGrid class:
    package ua.org.enginer.controls {
         import flash.events.KeyboardEvent;
         import mx.collections.ArrayCollection;
         import mx.controls.DataGrid;
         import mx.controls.dataGridClasses.DataGridColumn;
         import mx.core.ClassFactory;
         import mx.events.ListEvent;
         import ua.org.enginer.controls.renderers.DataGridSelectionIndicator;
          * [a] key for select all (like [Ctrl+a])
          * Indicate selection by CheckBoxes
         public class CheckSelectionDataGrid extends DataGrid {
              public function CheckSelectionDataGrid() {
                   super();
                   addEventListener(KeyboardEvent.KEY_DOWN, onKetDown)
                   function onKetDown(event:KeyboardEvent):void {
                        //if (event.ctrlKey && event.keyCode == 65) {
                        // My lovely IE do not pass [Ctrl+A]... so simply [a]
                        if (event.keyCode == 65) {
                             selectedItems = ArrayCollection(collection).source
                             dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK))
              // add DataGridColumn with checkBoxes
              override public function set columns(value:Array):void {
                   var selectionIndicators:DataGridColumn = new DataGridColumn()
                   selectionIndicators.itemRenderer = new ClassFactory(DataGridSelectionIndicator)
                   selectionIndicators.width = 20
                   selectionIndicators.sortable = false
                   selectionIndicators.resizable = false
                   value.push(selectionIndicators)
                   super.columns = value
              override public function set selectedItems(items:Array):void {
                   super.selectedItems = items
                   // for checkBoxes indication
                   dispatchEvent(new ListEvent(ListEvent.CHANGE))
              override public function set selectedIndices(indices:Array):void {
                   super.selectedIndices = indices
                   // for checkBoxes indication
                   dispatchEvent(new ListEvent(ListEvent.CHANGE))
    DataGridSelectionIndicator:
    package ua.org.enginer.controls.renderers {
         import flash.events.Event;
         import mx.controls.CheckBox;
         import mx.controls.DataGrid;
         import mx.controls.listClasses.BaseListData;
         import mx.events.ListEvent;
         public class DataGridSelectionIndicator extends CheckBox {
              public function DataGridSelectionIndicator() {
                   super();
                   addEventListener(Event.CHANGE, onChange)
                   setStyle("paddingLeft", 3)
              private function onChange(event:Event):void {
                   var grid:DataGrid = DataGrid(listData.owner)
                   var myIndex:int = grid.itemRendererToIndex(this)
                   if (selected) {
                        if (grid.selectedIndices.indexOf(myIndex)>=0) return;
                        var tmp:Array = grid.selectedIndices
                        tmp.push(grid.itemRendererToIndex(this))
                        grid.selectedIndices = tmp
                   else grid.selectedIndices = grid.selectedIndices.filter(function (...args):Boolean {
                        if (args[0] == myIndex) return false;
                        return true
              private function onItemClick(event:ListEvent):void {
                   var grid:DataGrid = DataGrid(listData.owner)
                   var myIndex:int = grid.itemRendererToIndex(this)
                   selected = grid.selectedIndices.indexOf(myIndex)>=0
              override public function set listData(value:BaseListData):void {
                   super.listData = value
                   var grid:DataGrid = DataGrid(value.owner)
                   grid.addEventListener(ListEvent.ITEM_CLICK, onItemClick)
                   //grid.addEventListener(ListEvent.CHANGE, onItemClick)
                   selected = false
              override public function set data(value:Object):void {
                   // prevent default behavior
    In attachments swf of:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
         xmlns:controls="ua.org.enginer.controls.*">
         <controls:CheckSelectionDataGrid allowMultipleSelection="true">
              <controls:dataProvider>
                   <mx:Array>
                        <mx:Object label="1"/>
                        <mx:Object label="2"/>
                        <mx:Object label="3"/>
                        <mx:Object label="4"/>
                        <mx:Object label="5"/>
                   </mx:Array>
              </controls:dataProvider>
         </controls:CheckSelectionDataGrid>
    </mx:Application>
    So if click on the last checkBox you will see unexpected behavior...

    Then click on the last checkBox all checkBoxes become uncheched

  • Custom datagrid sort

    Hello,
    I have a datagrid that has a row that contains information
    similar to this: 1,2,3,4,T4,T4,5,6,..17,29,..43,T44,T44,45.. and so
    on.. I hope you get the idea.. if an element appears more than one
    time, it has a "T" at the beginning (this data is from a database
    and I have to display it in this way). I have to be able to sort
    this numerically (making the sort function somehow ignore that
    "T")... i know datagrid only sorts strings, but using a Listener
    and some other things ( check this out
    http://www.flash-creations.com/notes/servercomm_database.php
    ) I managed to make it sort numbers.
    However, the function doesn't work properly it some elements
    have that "T" at the beginning. Is there an elegant way to do this?
    (other than writing my own sorting function - maybe bubble sort -
    sorting the dataprovider and then repopulating the datalist with
    the sorted dataprovider)

    Could you put the "T" in a different column or does it have
    to be in the same column as the number?

Maybe you are looking for

  • Arch PPC, a G4 and a Saturday

    I had some spare time Saturday. Well, actually, I had plenty of stuff to do, I just did not want to. I was sitting at my desk thinking of anything that I could be doing besides what I should be doing A shiny box in the corner of my office caught me e

  • Ipod nano a no show in itunes- but is in computer- newbie-Help!

    My old system barely exceeds the mins required & i use dialup. Just downloaded & installed itunes 7.1.059 to find 7.1.1 is a new 5hr download away or another trip to the library. Brand New Nano. Ipod shows up in my computer as removable disc. Shows i

  • How to populate values in a Listbox parameter in selection screens

    I have a parameter(as list box) field in selection screens. And now I want to populate a list from a ztable field values.  How to do that. Thanks in Advance

  • I can't find my project

    I was working on a project in Final Cut Pro 10.1 and my entire system just froze. I waited for about five minutes for the problem to fix itself, but nothing. So I did a hard shutdown. Fine. I open Final Cut back up, and go to my event. And my project

  • Robohelp 7 Web Admin

    Hello, I'm new to Robohelp 7 and I'm having a simply issue that I can't seem to figure out. I'm running Robohelp 7 Server on Windows XP Pro with IIS. The Robohelp 7 Server install was a success but when I try to login to the web admin page, it asks f