How not to sort datagrid column on double click

Hello,
I am currently building an application containing a datagrid for data representation. I've created a custom datagridheader in order to add a input text for filtering the columns (see code below).
My goal is to hide the textinput, and then show it on a double click on the header. So i would like to know how to avoid the sort of this column each time i double click.?
<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/mx" resize="onColumnResize(event)" clipAndEnableScrolling="true" doubleClick="managefilterField(event)">
    <fx:Declarations>
        <!--- The default value of the <code>sortIndicator</code> property.
        It must be an IFactory for an IVisualElement.       
        <p>This value is specified in a <code>fx:Declaration</code> block and can be overridden
        by a declaration with <code>id="defaultSortIndicator"</code>
        in an MXML subclass.</p>
        @langversion 3.0
        @playerversion Flash 10
        @playerversion AIR 2.0
        @productversion Flex 4.5
        -->
        <fx:Component id="defaultSortIndicator">
            <s:Path data="M 3.5 7.0 L 0.0 0.0 L 7.0 0.0 L 3.5 7.0" implements="spark.components.gridClasses.IGridVisualElement">
                <fx:Script>
                    <![CDATA[
                        import spark.components.DataGrid;
                        import spark.components.Grid;
                         *  @private
                        public function prepareGridVisualElement(grid:Grid, rowIndex:int, columnIndex:int):void
                            const dataGrid:DataGrid = grid.dataGrid;
                            if (!dataGrid)
                                return;
                            const color:uint = dataGrid.getStyle("symbolColor");
                            arrowFill1.color = color;
                            arrowFill2.color = color;
                    ]]>
                </fx:Script>
                <s:fill>
                    <s:RadialGradient rotation="90" focalPointRatio="1">   
                        <!--- @private -->
                        <s:GradientEntry id="arrowFill1" color="0" alpha="0.6" />
                        <!--- @private -->
                        <s:GradientEntry id="arrowFill2" color="0" alpha="0.8" />
                    </s:RadialGradient>
                </s:fill>
            </s:Path>
        </fx:Component>
        <!--- Displays the renderer's label property, which is set to the column's <code>headerText</code>.
        It must be an instance of a <code>TextBase</code>, like <code>s:Label</code>.
        <p>This visual element is added to the <code>labelDisplayGroup</code> by the renderer's
        <code>prepare()</code> method.   Any size/location constraints specified by the labelDisplay
        define its location relative to the labelDisplayGroup.</p>
        <p>This value is specified with a <code>fx:Declaration</code> and can be overridden
        by a declaration with <code>id="labelDisplay"</code>
        in an MXML subclass.</p>
        @langversion 3.0
        @playerversion Flash 10
        @playerversion AIR 2.0
        @productversion Flex 4.5
        -->
        <s:Label id="labelDisplay"
                 verticalCenter="1" left="0" right="0" top="0" bottom="0"
                 textAlign="start"
                 fontWeight="bold"
                 verticalAlign="middle"
                 maxDisplayedLines="1"
                 showTruncationTip="true" />
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            import net.awl.ismp.console.components.misc.FilterCriteria;
            import net.awl.ismp.console.events.ColumnFilteredEvent;
            import net.awl.ismp.console.events.ColumnResizedEvent;
            import mx.events.ResizeEvent;
            import spark.components.gridClasses.IGridVisualElement;
            import mx.core.IVisualElement;
            import spark.components.DataGrid;
            import spark.components.GridColumnHeaderGroup;
            import spark.components.gridClasses.GridColumn;
            import spark.primitives.supportClasses.GraphicElement;
            // chrome color constants and variables
            private static const DEFAULT_COLOR_VALUE:uint = 0xCC;
            private static const DEFAULT_COLOR:uint = 0xCCCCCC;
            private static const DEFAULT_SYMBOL_COLOR:uint = 0x000000;
            private static var colorTransform:ColorTransform = new ColorTransform();
             *  @private
            private function dispatchChangeEvent(type:String):void
                if (hasEventListener(type))
                    dispatchEvent(new Event(type));                   
            protected function onColumnResize(event:ResizeEvent):void
                dispatchEvent(new ColumnResizedEvent(ColumnResizedEvent.COLUMNRESIZED_EVT,this.width,this.column.columnInde x));
            //  maxDisplayedLines
            private var _maxDisplayedLines:int = 1;
            [Bindable("maxDisplayedLinesChanged")]
            [Inspectable(minValue="-1")]
             *  The value of this property is used to initialize the
             *  <code>maxDisplayedLines</code> property of this renderer's
             *  <code>labelDisplay</code> element.
             *  @copy spark.components.supportClasses.TextBase#maxDisplayedLines
             *  @default 1
             *  @langversion 3.0
             *  @playerversion Flash 10
             *  @playerversion AIR 1.5
             *  @productversion Flex 4.5
            public function get maxDisplayedLines():int
                return _maxDisplayedLines;
            override protected function stateChanged(oldState:String, newState:String, recursive:Boolean):void
                trace("state changed from : "+oldState+" to "+newState);
                super.stateChanged(oldState, newState, recursive);
             *  @private
            public function set maxDisplayedLines(value:int):void
                if (value == _maxDisplayedLines)
                    return;
                _maxDisplayedLines = value;
                if (labelDisplay)
                    labelDisplay.maxDisplayedLines = value;
                invalidateSize();
                invalidateDisplayList();
                dispatchChangeEvent("maxDisplayedLinesChanged");
            //  sortIndicator
            private var _sortIndicator:IFactory;
            private var sortIndicatorInstance:IVisualElement;
            [Bindable("sortIndicatorChanged")]
             *  A visual element that's displayed when the column is sorted.
             *  <p>The sortIndicator visual element is added to the <code>sortIndicatorGroup</code>
             *  by this renderer's <code>prepare()</code> method.  Any size/location constraints
             *  specified by the sortIndicator define its location relative to the sortIndicatorGroup.</p>
             *  @default null
             *  @langversion 3.0
             *  @playerversion Flash 10
             *  @playerversion AIR 1.5
             *  @productversion Flex 4.5
            public function get sortIndicator():IFactory
                return (_sortIndicator) ? _sortIndicator : defaultSortIndicator;
             *  @private
            public function set sortIndicator(value:IFactory):void
                trace("setSortIndicator");
                if (_sortIndicator == value)
                    return;
                _sortIndicator = value;
                if (sortIndicatorInstance)
                    sortIndicatorGroup.includeInLayout = false;
                    sortIndicatorGroup.removeElement(sortIndicatorInstance);
                    sortIndicatorInstance = null;
                invalidateDisplayList();
                dispatchChangeEvent("sortIndicatorChanged");
             *  @private
             *  Create and add the sortIndicator to the sortIndicatorGroup and the
             *  labelDisplay into the labelDisplayGroup.
            override public function prepare(hasBeenRecycled:Boolean):void
                trace("prepare !!");
                super.prepare(hasBeenRecycled);
                if (labelDisplay && labelDisplayGroup && (labelDisplay.parent != labelDisplayGroup))
                    labelDisplayGroup.removeAllElements();
                    labelDisplayGroup.addElement(labelDisplay);
                trace(sortIndicator);
                trace("sortIndicatorInstance : "+sortIndicatorInstance);
                const column:GridColumn = this.column;
                if (sortIndicator && column && column.grid && column.grid.dataGrid && column.grid.dataGrid.columnHeaderGroup)
                    const dataGrid:DataGrid = column.grid.dataGrid;
                    const columnHeaderGroup:GridColumnHeaderGroup = dataGrid.columnHeaderGroup;
                    if (columnHeaderGroup.isSortIndicatorVisible(column.columnIndex))
                        if (!sortIndicatorInstance)
                            sortIndicatorInstance = sortIndicator.newInstance();
                            sortIndicatorGroup.addElement(sortIndicatorInstance);
                            chromeColorChanged = true;
                            invalidateDisplayList();
                        // Initialize sortIndicator
                        sortIndicatorInstance.visible = true;
                        const gridVisualElement:IGridVisualElement = sortIndicatorInstance as IGridVisualElement;
                        if (gridVisualElement)
                            gridVisualElement.prepareGridVisualElement(column.grid, -1, column.columnIndex);
                        sortIndicatorGroup.includeInLayout = true;
                        sortIndicatorGroup.scaleY = (column.sortDescending) ? 1 : -1;
                    else
                        if (sortIndicatorInstance)
                            sortIndicatorGroup.removeElement(sortIndicatorInstance);
                            sortIndicatorGroup.includeInLayout = false;
                            sortIndicatorInstance = null;
            private var chromeColorChanged:Boolean = false;
            private var colorized:Boolean = false;
             *  @private
             *  Apply chromeColor style.
            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                //trace("update display list");
                // Apply chrome color
                if (chromeColorChanged)
                    var chromeColor:uint = getStyle("chromeColor");
                    if (chromeColor != DEFAULT_COLOR || colorized)
                        colorTransform.redOffset = ((chromeColor & (0xFF << 16)) >> 16) - DEFAULT_COLOR_VALUE;
                        colorTransform.greenOffset = ((chromeColor & (0xFF << 8)) >> 8) - DEFAULT_COLOR_VALUE;
                        colorTransform.blueOffset = (chromeColor & 0xFF) - DEFAULT_COLOR_VALUE;
                        colorTransform.alphaMultiplier = alpha;
                        transform.colorTransform = colorTransform;
                        var exclusions:Array = [labelDisplay, sortIndicatorInstance];
                        // Apply inverse colorizing to exclusions
                        if (exclusions && exclusions.length > 0)
                            colorTransform.redOffset = -colorTransform.redOffset;
                            colorTransform.greenOffset = -colorTransform.greenOffset;
                            colorTransform.blueOffset = -colorTransform.blueOffset;
                            for (var i:int = 0; i < exclusions.length; i++)
                                var exclusionObject:Object = exclusions[i];
                                if (exclusionObject &&
                                    (exclusionObject is DisplayObject ||
                                        exclusionObject is GraphicElement))
                                    colorTransform.alphaMultiplier = exclusionObject.alpha;
                                    exclusionObject.transform.colorTransform = colorTransform;
                        colorized = true;
                    chromeColorChanged = false;
                super.updateDisplayList(unscaledWidth, unscaledHeight);
             *  @private
            override public function styleChanged(styleProp:String):void
                var allStyles:Boolean = !styleProp || styleProp == "styleName";
                super.styleChanged(styleProp);
                if (allStyles || styleProp == "chromeColor")
                    chromeColorChanged = true;
                    invalidateDisplayList();
            protected function managefilterField(event:MouseEvent):void
                trace("double click sortIndicator : "+this.sortIndicatorInstance);
                this.filterInput.visible=!this.filterInput.visible;
                this.filterInput.includeInLayout=this.filterInput.visible;
                this.filterSpacer.visible=this.filterInput.visible;
                this.filterSpacer.includeInLayout=this.filterInput.visible;
                if(!this.filterInput.visible)
                    this.filterInput.text="";
                    dispatchEvent(new ColumnFilteredEvent(ColumnFilteredEvent.COLUMNFILTERED_EVT,new FilterCriteria(this.column.dataField,this.filterInput.text)));
                this.filterInput.setStyle("borderColor",0xFF6319);
                this.filterInput.setStyle("focusColor",0xFF6319);
                //this.filterInput.setStyle(
            protected function onTextInputSelection(event:MouseEvent):void
                event.stopImmediatePropagation();
                this.filterInput.setStyle("borderColor",0xFF6319);
                this.filterInput.setStyle("focusColor",0xFF6319);
            protected function onKeyUp(event:KeyboardEvent):void
                if(event.charCode==Keyboard.ENTER)
                    stage.focus=null;
            protected function onFocusOut(event:FocusEvent):void
                this.filterInput.setStyle("borderColor",0x00ff00);
                this.filterInput.setStyle("focusColor",0x70B2EE);
                dispatchEvent(new ColumnFilteredEvent(ColumnFilteredEvent.COLUMNFILTERED_EVT,new FilterCriteria(this.column.dataField,this.filterInput.text)));
        ]]>
    </fx:Script>
    <s:states>
        <s:State name="normal" />
        <s:State name="hovered" />
        <s:State name="down" />
    </s:states>     
    <!-- layer 1: shadow -->
    <!--- @private -->
    <s:Rect id="shadow" left="-1" right="-1" top="-1" bottom="-1" radiusX="2">
        <s:fill>
            <s:LinearGradient rotation="90">
                <s:GradientEntry color="0x000000"
                                 color.down="0xFFFFFF"
                                 alpha="0.01"
                                 alpha.down="0" />
                <s:GradientEntry color="0x000000"
                                 color.down="0xFFFFFF"
                                 alpha="0.07"
                                 alpha.down="0.5" />
            </s:LinearGradient>
        </s:fill>
    </s:Rect>
    <!-- layer 2: fill -->
    <!--- @private -->
    <s:Rect id="fill" left="0" right="0" top="0" bottom="0">
        <s:fill>
            <s:LinearGradient rotation="90">
                <s:GradientEntry color="0xFFFFFF"
                                 color.hovered="0xBBBDBD"
                                 color.down="0xAAAAAA"
                                 alpha="0.85" />
                <s:GradientEntry color="0xD8D8D8"
                                 color.hovered="0x9FA0A1"
                                 color.down="0x929496"
                                 alpha="0.85" />
            </s:LinearGradient>
        </s:fill>
    </s:Rect>
    <!-- layer 3: fill lowlight -->
    <!--- @private -->
    <s:Rect id="lowlight" left="0" right="0" top="0" bottom="0">
        <s:fill>
            <s:LinearGradient rotation="270">
                <s:GradientEntry color="0x000000" ratio="0.0" alpha="0.0627" />
                <s:GradientEntry color="0x000000" ratio="0.48" alpha="0.0099" />
                <s:GradientEntry color="0x000000" ratio="0.48001" alpha="0" />
            </s:LinearGradient>
        </s:fill>
    </s:Rect>
    <!-- layer 4: fill highlight -->
    <!--- @private -->
    <s:Rect id="highlight" left="0" right="0" top="0" bottom="0">
        <s:fill>
            <s:LinearGradient rotation="90">
                <s:GradientEntry color="0xFFFFFF"
                                 ratio="0.0"
                                 alpha="0.33"
                                 alpha.hovered="0.22"
                                 alpha.down="0.12"/>
                <s:GradientEntry color="0xFFFFFF"
                                 ratio="0.48"
                                 alpha="0.33"
                                 alpha.hovered="0.22"
                                 alpha.down="0.12" />
                <s:GradientEntry color="0xFFFFFF"
                                 ratio="0.48001"
                                 alpha="0" />
            </s:LinearGradient>
        </s:fill>
    </s:Rect> 
    <!-- layer 5: highlight stroke (all states except down) -->
    <!--- @private -->
    <s:Rect id="highlightStroke" left="0" right="0" top="0" bottom="0" excludeFrom="down">
        <s:stroke>
            <s:LinearGradientStroke rotation="90" weight="1">
                <s:GradientEntry color="0xFFFFFF" alpha.hovered="0.22" />
                <s:GradientEntry color="0xD8D8D8" alpha.hovered="0.22" />
            </s:LinearGradientStroke>
        </s:stroke>
    </s:Rect>
    <!-- layer 6: highlight stroke (down state only) -->
    <!--- @private -->
    <s:Rect id="hldownstroke1" left="0" right="0" top="0" bottom="0" includeIn="down">
        <s:stroke>
            <s:LinearGradientStroke rotation="90" weight="1">
                <s:GradientEntry color="0x000000" alpha="0.25" ratio="0.0" />
                <s:GradientEntry color="0x000000" alpha="0.25" ratio="0.001" />
                <s:GradientEntry color="0x000000" alpha="0.07" ratio="0.0011" />
                <s:GradientEntry color="0x000000" alpha="0.07" ratio="0.965" />
                <s:GradientEntry color="0x000000" alpha="0.00" ratio="0.9651" />
            </s:LinearGradientStroke>
        </s:stroke>
    </s:Rect>
    <!--- @private -->
    <s:Rect id="hldownstroke2" left="1" right="1" top="1" bottom="1" includeIn="down">
        <s:stroke>
            <s:LinearGradientStroke rotation="90" weight="1">
                <s:GradientEntry color="0x000000" alpha="0.09" ratio="0.0" />
                <s:GradientEntry color="0x000000" alpha="0.00" ratio="0.0001" />
            </s:LinearGradientStroke>
        </s:stroke>
    </s:Rect>
    <!--<s:Rect id="fill" left="0" right="0" top="0" bottom="0">
        <s:fill>
            <s:LinearGradient rotation="90">
                <s:GradientEntry color.normal="0xf9f9f9" color.hovered="0xfcfdfa"
                                 color.down="0xdceac2" alpha="0.85" />
                <s:GradientEntry color.normal="0xeaeaea" color.hovered="0xdceac2"
                                 color.down="0xd2e1b5" alpha="0.85" />
            </s:LinearGradient>
        </s:fill>
    </s:Rect>-->
    <!--<s:VGroup left="7" right="7" top="5" bottom="5" gap="6" verticalAlign="middle">
        <s:TextInput width="100%" />
        <s:HGroup width="100%">
            <s:Group id="labelDisplayGroup" width="100%" />
            <s:Group id="sortIndicatorGroup" includeInLayout="false" />
        </s:HGroup>
    </s:VGroup>-->
    <s:VGroup verticalAlign="middle" left="7" top="5" right="7" bottom="5" gap="2" >
        <s:TextInput id="filterInput" width="100%" visible="false" includeInLayout="false" keyUp="onKeyUp(event)" focusOut="onFocusOut(event)" click="onTextInputSelection(event)"/>
        <s:Spacer id="filterSpacer" visible="false" includeInLayout="false" height="5" />
    <s:HGroup width="100%" height="100%" verticalAlign="middle">
        <s:Group id="labelDisplayGroup" width="100%" />
        <s:Group id="sortIndicatorGroup" includeInLayout="false" />
    </s:HGroup>
    </s:VGroup>
</s:GridItemRenderer>

Based on your idea, i've intercepted the click event and I use stopImmediatePropagation.
THen i added an image to sort the column. So if the image is clicked the sort is ok.

Similar Messages

  • Expanding the datagrid column on double-click?

    The title says it all...
    How do i get it to expand to certain value?

    This is not a Flex Builder question, so it should go in the
    General Discussion forum, not here.
    Regarding the question, set the colum width.
    Tracy

  • Pages:  How can I sort one column of words and not have it affect the other columns?

    How can I sort one column of words and not have it affect the other columns?  I have opened the inspector to the edit columns and rows under Table.  It will sort the column, but then it changes the other colums as well.  I know that if I use Numbers, it will work, but I want to know how to do the same thing in Pages.

    Hi Peter,
    Numbers sorts full rows on values in selected column(s). The technique for sorting a single column is essentially the same as Jerry is describing for Pages tables—separate the (data in the) column to be sorted, sort it, return it to the table.
    In Numbers the actual column may be separated from the original table, sorted, then returned. In Pages, the data must be extracted, sorted, then pasted back in, overwriting the unsorted data (if it was left in the original table).
    iWork tables follow a database model in which each row is a Record, and each column holds a Field within the records.
    As evidenced by the current question (and several similar questions arising in the Numbers community) that model doesn't apply to the way some users, especially some who come in from the MS Excel world, use tables.
    With Excels model—islands of data on a single large table, the ability to sort one or a selected few columns of data makes sense. One 'island' may comprise only cells AA21:AH50. Sorting that small 'table' should be possible without disturbing the rest of rows 21-30, which are probably part of one or more other 'data islands' in the sea that is a MS Excel spreadsheet.
    In Numbers, each of those 'islands' would be a separate Table, and that Table would be sortable without disturbing other Tables in the document.
    Regards,
    Barry

  • How I can sort all columns alphabetically? in Itunes

    How I can sort all columns alphabetically? in Itunes

    I have the same problem.
    I've went through the pains of merging all chapters into one big file for each and every audiobook, so that at least the chapters don't get played in random order. Month and month of work….. In iTunes 12.01. I can now order my audiobooks by title or by author.
    But once they're uploaded to my blo*dy expensive iPhone 6Plus 128 (which I bought especially to have all my music and my audiobooks on one device) my audiobooks are NOT sorted by author, but by Title.
    So, let's say I have 15 books by Ken Follet, they don't appear as Ken Follet > Title of the book but they are sorted alphabetically with all the other titles of other authors.
    iPods where originally designed for music and audiobooks, but each and every version of iOS makes handling your music and especially your audiobooks harder and harder….
    I am very disappointed and after so many years of using apple, I am considering to move on to android devices.

  • How to bind each DataGrid column separately?

    Good day fellow Flex developers!
    Could you please help me out. I am trying to figure out how to bind each DataGrid column separately. I need to bind each column to a separate bindable array variable. Is there a dataProvider property for each DataGridColumn???
    Thanks in advance,
    Eugene

    hopefully nope
    just imagine code complexity for that feature?
    how would you think should behave DataGrid when you'll populate your separate arrays with variable items number each?
    all you are able and should do is to build composite dataProvider source, join all your separate arrays into it, this is your responsibility.
    If you feel this message answers your question or helps, please mark it respectively

  • Adobe digital editions will not finish downloading ebook  even after double clicking on hard drive .

    ADE will not download and open the ebook automatially. After locating the .ascm (ebook) file on the hard drive and double clicking on that, it still will not open in ADE.

    I did all that and after I close the ADE and double click on the file, ADE opens right up and it looks like it is downloading (very fast), but nothing shows up in the ADE.
    How do I only get emails from you and not all the other people on the discussion?
    Date: Fri, 23 Dec 2011 15:48:24 -0700
    From: [email protected]
    To: [email protected]
    Subject: Adobe digital editions will not finish downloading ebook  even after double clicking on hard drive .
        Re: Adobe digital editions will not finish downloading ebook  even after double clicking on hard drive .
        created by Jeff A Wright in Adobe Digital Editions - View the full discussion
    Right click on the ACSM file or option click and go to Open With and select Other.  You can then navigate to your Adobe Digital Editions and set the file to open with that. I would then recommend closing Digital Editions, if you have it open, and try double clicking the file.  If Adobe Digital Editions opens then the file association is still correct.  If you continue to have difficulties then I would recommend contacting the vendor you obtained the e-book from.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4101791#4101791
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4101791#4101791. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Adobe Digital Editions by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • I have just installed os7. How do I close apps when I double click on home button

    I have just installed os7. How do I close apps when I double click on home button

    Swipe to the app you want to close, press and hold the large image and swipe up and off the screen

  • I need to recover all my notes from Ghostwriter. When I double click the icon nothing happens. I am sick to my stomach! Can anyone help me?

    i need to recover all my notes from Ghostwriter. When I double click the icon nothing happens. I am sick to my stomach! Can anyone help me?

    Try to backup and restore you device in itunes...restoring the device is like removing the iOS software off the device and re-add in a newer software, after you have restore you device, MAKE SURE YOU SET UP YOUR DEVICE LIKE A NEW DEVICE, DONT NOT RESTORE FROM BACKUP!!... give the device a chance to use the newer software and see if the issue still persisting, if the issue still on going then its would be a hardware issue.
    Call Apple Care and see if your device is still under warranty to get it replace

  • How to change sorting in column view in Maverick

    I understand how to change the view and then "arrange by".  In my columns, they list from oldest to newest.  I don't see how to reverse that.  I want newest on top.  Also, how do I set the column width to what I want and save for all?  I can adjust the column width, but it defautlts back to the narrow setting shortly after.

    Excuse me my English. It is not my problem.
    I need to ensure this thing:
    When user click on any head of column in output table (table view) it must not call any event. All data must stay on same rows.
    Example. A have table:
    Col1        Col2
    B           20
    A           30
    T           10
    D           60
    If I click on first head of column data will be sorted:
    Col1        Col2
    A           30
    B           20
    D           60
    T           10
    But if hierachy or structure are in first column rows cannot be changed.

  • How can I sort two columns?

    I've got two columns of text (names of people, actually) in a Numbers spreadsheet. I've selected all the cells and made sure they are "text" format. I cannot figure out how to sort (alphabetically) the two columns independent of one another.
    I just want two columns of names in alphabetical order. How do I do it? Every time I select one column and sort by ascending it affects the column(s) next to it.

    Not sure I totally understand the actual question. But let me give it a shot...
    Column A = Last Name, Column B = First Name. You want to sort this list of names by Last Name, then by First Name so John Smith shows up below Alex Smith on your list. Typically you would have MULTIPLE columns of data to go along with the names; Phone, Address, City, State, Zip, etc. Right? So if you Sort only ONE column (and ONLY that column, you end up with John Smith having the wrong address, etc. etc. SO, most Spreadsheets allow you to sort multiple columns at the same time, but by only one Column Title at a time. This keeps the rest of the data in the Record in the right place. Thus, you sort Column A (Last Name) in Asending order. Now all the LAST Names are alphabetical. Next, you sort Column B (First Name) in Asending order. Now the list should show up with the last Names in the correct order, AND the First Names also - BUT all the other info (address, City, State, etc) is ALSO still attached to the right records. Clear as MUD?!
    P.S. This will ONLY work when your Title Box for each Column has a SINGLE Line of text:
    Like THIS: Last Name
    NOT THIS: Last
    Name
    The Spreadsheet will leave the TOP ROW (Titles) alone, and sort the Rows beneath the Title Boxes.
    Good luck...

  • Sort datagrid column in groupby

    Hai
      can any one help to sort the advanced datagrid column in ascending
      by default the values will be in groupby format..
      how to sort in groupby...
    Thanks in Advance

    Hai
      can any one help to sort the advanced datagrid column in ascending
      by default the values will be in groupby format..
      how to sort in groupby...
    Thanks in Advance

  • Strange application behaviour after try to sort datagrid column

    Hi all
    I have a simple Air desktop application with customized DataGrid (Spark version). Problem that users found is when they trying to sort grid by one of the columns applicaiton closes without any messages. I've repeated this bug on my PC but there is a problem - in debug mode (i mean with ADL) it works OK without any tries to crash on sort. So my questions in priority order:
    1. Is that possible to obtain live Air application errors log? I mean after installation. Maybe with 3rd party applicaiton. I'm using MonsterDebugger and added few log messages but looks like application just crashes without firing closing or close event.
    2. Which part of DataGrid could crash applicaiton in release mode? Just thought debug mode is more strict.
    My dev system:
    Flash Builder 4.6
    Adobe Air 3.2
    Win 7 Ultimate 64bit
    Best regards, Roman
    P.S. Sorry for my bad english

    Based on your idea, i've intercepted the click event and I use stopImmediatePropagation.
    THen i added an image to sort the column. So if the image is clicked the sort is ok.

  • How to make spark datagrid columns to behave like mx datagrid columns

    Hello.
    I have a problem with spark datagrid component. I can't force spark datagrid columns behave like old mx datagrid columns. In mx datagrid columns fills 100% of datagrid regardles of resizing column or datagrid itself (it will not show horizontal scrolling bar). In spark datagrid last column (colC) will never word wrap, event after setting horizontalScrollPolicy=off. I would like to somehow constrain spark columns to behave like mx ones.
    App snippet (try to resize app and columns - especially colC - and you will see what I mean):
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx">
        <fx:Declarations>
            <s:ArrayCollection id="dp">
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
            </s:ArrayCollection>
        </fx:Declarations>
        <s:layout>
            <s:HorizontalLayout/>
        </s:layout>
        <s:DataGrid id="grid" width="100%" height="100%" dataProvider="{dp}" variableRowHeight="true" horizontalScrollPolicy="off">
            <s:columns>
                <s:ArrayList>
                    <s:GridColumn headerText="Column A" dataField="colA"/>
                    <s:GridColumn headerText="Column B" dataField="colB"/>
                    <s:GridColumn headerText="Column C" dataField="colC"/>
                </s:ArrayList>
            </s:columns>
        </s:DataGrid>
        <mx:DataGrid id="grid2" width="100%" height="100%" dataProvider="{dp}" wordWrap="true" variableRowHeight="true">
            <mx:columns>
                <mx:DataGridColumn headerText="Column A" dataField="colA"/>
                <mx:DataGridColumn headerText="Column B" dataField="colB"/>
                <mx:DataGridColumn headerText="Column C" dataField="colC"/>
            </mx:columns>
        </mx:DataGrid>
    </s:Application>

    the datagrid has sortItems and sortItemsOn methods you can use.

  • TableView Column Mouse Double Click

    Hi,
    I have a table view, if a user double clicks a row - I do something. I notice that if I double click on the header of a column, I receive an ActionEvent just as if the user double clicked a row. Single clicks on the header perform sorting as expected.
    Is here a way to see if the double click mouse event happened on the column header?
    Thanks.

    Depends how you set your event, imo there should be a way to give an event to just a row, if you defined your rows and columns some way(I'm not too sure as I don't have much experience with tables yet...)
    row.addEventHandler(mousEvent.ANY, some event);

  • CL_SALV_TREE: How to read the value of a double-clicked field

    Hey Guys!
    I have build a list with CL_SALV_TREE. When the user makes a DOUBLE CLICK in a especially field of a line I want to call a transaction with the field's value.
    Can you please tell me how exactly I can get the value of the double-clicked field?
    Reacting on the double-click-event is no problem (thanks to the sap-sample-codes), but I just don't know how to find the item-value having node-key and columname.
    I got this far:
    *       CLASS lcl_handle_events DEFINITION
    class lcl_handle_events definition.
      public section.
        methods:
          on_double_click for event double_click of cl_salv_events_tree
            importing node_key columnname.
    endclass.                    "lcl_handle_events DEFINITION
    *       CLASS lcl_handle_events IMPLEMENTATION
    class lcl_handle_events implementation.
      method on_double_click.
    *   selecting field's value
    *   call transaction
        message i000(0k) with node_key columnname. 'just for test
    endmethod.                    "on_double_click
    endclass.                    "lcl_handle_events IMPLEMENTATION
    I googled a lot and also searched in this forum and found some questions to a similar topic, but no solution to my problem.
    Can you help me with some example-code?
    Thank you very much!!!

    You need to get the Node and node value of the selected column like this.
    METHOD on_double_click.
        DATA: lr_nodes TYPE REF TO cl_salv_nodes,
              lr_node  TYPE REF TO cl_salv_node,
              lr_val   TYPE REF TO  cl_salv_item,
              lr_data  TYPE REF TO data.
        FIELD-SYMBOLS: <lv_val> TYPE ANY.
        lr_nodes = gr_tree->get_nodes( ).           " All nodes
        lr_node = lr_nodes->get_node( node_key ).   " selected node
        IF columnname IS NOT INITIAL.
          lr_val =  lr_node->get_item( columnname ).   " Object for selected column
          lr_data = lr_val->get_value( ).              " value of selected column
          ASSIGN lr_data->* TO <lv_val>.
        ENDIF.
      ENDMETHOD.                    "on_double_click
    Regards,
    Naimesh Patel

Maybe you are looking for

  • Apple Notes cannot be opened!

    Hi, Apple software engineer Today, I opend the Notes and found two same notes,So, I deleted one.Then, I cannot open it anymore. I look forward to hearing from you. Regards! Golden Jin <E-mail Edited by Host>

  • I messed up install of Zen Nano Plus 1

    Windows XP Home SP2 Windows Media Player 0 (will use with Zen Nano Plus) Dell 8250 ?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /> During the CD install, I had some questions and interruptions that required me to cancel, exit

  • Iphone 3G in a reboot cycle...

    Hello, Well one day i thought i would update my iphone, because some of the apps i wanted required this update. So i go ahead and update also restoring it to factory setting and deleting my apps. Later on that day i'm over my girlfriends and it's all

  • Why when I burn to disc a playlist in itunes (audio files) it will play in a portable cd player, but won't play in two different auto cd players?

    Why when I burn a playlist (audio files) to a cd-rw, it will play in a portable cd player, but when attempting to play in two different auto cd players it won't play and reads as "error"?

  • Report call from FORMS

    Hi Can we apply both below methods to call paper layout or web lay out 1. WEB.SHOW_DOCUMENT() 2. RUN_REPORT_OBJECT() Or else web lay out reports call only from one of them? Rgds Shabar