Spark Datagrid Selection change Event

starting to work with the spark datagrid.
I want to send off a web service using the values of a row right after they get done editing the row and leave it.
No more change event that I can see like MX and gridItemEditorSessionSaveHandler kicks on every tab between cells
if I use event.currentTarget.selectedItem
Selection Change gives me the new row.
Selection Changing only kicks with mouse row changes not tabs
Suggestions?
I want to register the row with both mouse (on a numeric stepper) and tab(for text fields) events.
Thanks
Dan Pride

Hi Dan,
Try valueCommit event handler, but I'm not 100% sure that is triggered upon dataProvider data changes.
Another way is to listen for changes in the dataProvider variable.

Similar Messages

  • How to generate selection change event through code in JTree?

    I am developing an application which downloads the file from other system and adds it into the tree. On selecting any file in the tree I m displaying it's contents. But now i am trying to display the contents of downloaded file as soon as it's download completes. Here i am not getting the way to how to generate the event as the download completes, because i tried that setSelectionPath(TreePath path), but it also don't generates the selection change event. Is there any other way to do so?

    Put null in place of oldLeadSelectionPath. From the API for TreeSelectionEvent:
    protected TreePath     oldLeadSelectionPath:
    leadSelectionPath before the paths changed, may be null.
    I'm at the office and can't try out anything, so please let me know whether that works for you.
    db
    edit Or it may be easier to put all code from your valueChanged (...) override in a new method and invoke that method both from valueChanged (...) and wherever else you need.
    Edited by: Darryl.Burke

  • How to change images of selected items in gridview on selection changed event in universal app

    Hi,
    I am developing Universal App. I have bind the images to the Gridview using ObservableCollection. I have set gridview
    SelectionMode as Multiple . I want to change the images of selected items but I don't know how to do in Selection Changed event of Gridview. I got selected items with the help of
    Gridview SelectedItems property. How can i change the images of respected selected items?
    Please reply me asap.
    Thanks in advance.

    Hi, Sorry for late reply,
    Please change the class : 
    public class ImageCollection : INotifyPropertyChanged
    private string source;
    public string Source
    get { return source; }
    set { SetProperty(ref source, value); }
    public int MyProperty { get; set; }
    protected void SetProperty<T>(ref T storage, T value, [System.Runtime.CompilerServices.CallerMemberName] String propertyName = null)
    if (!object.Equals(storage, value))
    storage = value;
    if (PropertyChanged != null)
    PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    protected void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] String propertyName = null)
    if (PropertyChanged != null)
    PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    public event PropertyChangedEventHandler PropertyChanged;
    XAML
    <GridView x:Name="gd"
    Tapped="gd_Tapped">
    <GridView.ItemTemplate>
    <DataTemplate>
    <Grid Height="300" Width="250">
    <Image Source="{Binding Source}" Stretch="Fill"/>
    <Grid Height="100" Background="#B2000000" VerticalAlignment="Bottom">
    <TextBlock Text="{Binding MyProperty}" FontSize="25" />
    </Grid>
    </Grid>
    </DataTemplate>
    </GridView.ItemTemplate>
    </GridView>
    C#
    //ObservableCollection of class
    ObservableCollection<ImageCollection> img = new ObservableCollection<ImageCollection>();
    public MainPage()
    this.InitializeComponent();
    img.Add(new ImageCollection() { MyProperty = 1, Source = "ms-appx:///Assets/Logo.scale-100.png" });
    img.Add(new ImageCollection() { MyProperty = 2, Source = "ms-appx:///Assets/2.jpg" });
    img.Add(new ImageCollection() { MyProperty = 3, Source = "ms-appx:///Assets/3.jpg" });
    img.Add(new ImageCollection() { MyProperty = 4, Source = "ms-appx:///Assets/4.jpeg" });
    gd.ItemsSource = img;
    private void gd_Tapped(object sender, TappedRoutedEventArgs e)
    GridView gv = (GridView)sender;
    ImageCollection ic = gv.SelectedItem as ImageCollection;
    ic.Source = "ms-appx:///Assets/4.jpeg";
    gv.UpdateLayout();
    I have used  INotifyPropertyChanged now UI is not fluctuate 
    and I have not bind again O-Collection.
    I hope so You will get right answer. 
    shah

  • CFDebug says, "widget: Firing selection change event for tree id: t1"

    How do I capture this event and code against it.  Previously used this code to trap click event:
    YAHOO.example.onTreeViewAvailble = function() {
      var curTree=ColdFusion.Tree.getTreeObject('t1');
      curTree.subscribe("labelClick", function(node) {  
       TreeItemClick(1,node.data.id)
      When the tree becomes available (ie. after the page loads),
      this code will run the code above this.
      "t1"- tree name in the cftree tag
    YAHOO.util.Event.onAvailable("t1", YAHOO.example.onTreeViewAvailble); 
    I am obviously not an expert with the Yahoo widgets, but I'm learning.
    This stopped working for some reason.  However the CFDebug consistently shows the subject event happening on every mouse click.  I'd rather just use that.  Any ideas?

    Roy, have you tried to reduce the complexity of your user case?
    Try your use case with a simple page without a region in it first and see if you get the eating them. If yes add a region to your page and verify you get the result you expect. Only then add the portal stuff.
    This will help to narrow down the error.
    Timo

  • How can I set a property when an event happens? (selection changed on datagrid)

    I have a datagrid, I would like to change the backgrund of the datagrid when the selection changed event is fired.
    I can not use data trigger, because is in the case that I expected a value, but in this case is when change, to any value.
    An option is to use an event trigger, but all the examples that I have found is to use with an actions, and I just want to set a property.
    How could I do that?
    I am using MVVM pattern, so I would like to avoid the use in code-behind.
    Thank so much.

    You could use an event trigger and implement your own TriggerAction<T> that sets the background property. There is an example of how to create a custom TriggerAction available here:
    http://stackoverflow.com/questions/942548/setting-a-property-with-an-eventtrigger.
    The following example sets the Background property of the DataGrid to a red SolidColorBrush when the SelectionChanged event is fired. It should give you the idea:
    <DataGrid x:Name="dgrid"
    xmlns:local="clr-namespace:WpfApplication22">
    <i:Interaction.Triggers>
    <i:EventTrigger EventName="SelectionChanged">
    <local:SetPropertyAction PropertyName="Background" TargetObject="{Binding ElementName=dgrid}">
    <local:SetPropertyAction.PropertyValue>
    <SolidColorBrush>Red</SolidColorBrush>
    </local:SetPropertyAction.PropertyValue>
    </local:SetPropertyAction>
    </i:EventTrigger>
    </i:Interaction.Triggers>
    <DataGrid.Columns>
    namespace WpfApplication22
    public class SetPropertyAction : TriggerAction<FrameworkElement>
    public string PropertyName
    get { return (string)GetValue(PropertyNameProperty); }
    set { SetValue(PropertyNameProperty, value); }
    public static readonly DependencyProperty PropertyNameProperty
    = DependencyProperty.Register("PropertyName", typeof(string),
    typeof(SetPropertyAction));
    public object PropertyValue
    get { return GetValue(PropertyValueProperty); }
    set { SetValue(PropertyValueProperty, value); }
    public static readonly DependencyProperty PropertyValueProperty
    = DependencyProperty.Register("PropertyValue", typeof(object),
    typeof(SetPropertyAction));
    public object TargetObject
    get { return GetValue(TargetObjectProperty); }
    set { SetValue(TargetObjectProperty, value); }
    public static readonly DependencyProperty TargetObjectProperty
    = DependencyProperty.Register("TargetObject", typeof(object),
    typeof(SetPropertyAction));
    protected override void Invoke(object parameter)
    object target = TargetObject ?? AssociatedObject;
    PropertyInfo propertyInfo = target.GetType().GetProperty(
    PropertyName,
    BindingFlags.Instance|BindingFlags.Public
    |BindingFlags.NonPublic|BindingFlags.InvokeMethod);
    propertyInfo.SetValue(target, PropertyValue);
    For more information about how to hook up event triggers and handle events in MVVM, please refer to my blog post:
    http://blog.magnusmontin.net/2013/06/30/handling-events-in-an-mvvm-wpf-application/
    Please also remember to mark helpful posts as answer.

  • Selection issue with editable Spark DataGrid

    Hi everyone,
    I am evaluating the new Spark DataGrid and I'm having a very strange issue with the behavior of selection 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 issue:
    select the very first cell at the top-left corner of the grid (the one with "Gabriele");
    click on it once more, the editor appears;
    now click on the cell just to the right of it (the one with "Genta").
    You should see that editing ends as it supposed to do, but selection is placed on the third cell (the one with a 5 in it) instead on the one you clicked on. Playing a little with the grid you should see that this isn't the only case, but selection is really behaving randomly.
    I am using SDK 4.5.1.21328.
    I think this is a very basic usage case.. I can't believe this is not working properly, what am I missing?
    Thanks a lot,
    Gabriele Genta
    Message was edited to add live example

    Your running into a known bug, https://bugs.adobe.com/jira/browse/SDK-30088.
    The  bug will be fixed in the Mega release. To work around the bug you can  create a custom editor and remove the  "dataGrid.validateNow();" call in  DataGridEditor.save().
    Here's how I modified your example to workaround the bug:
    <?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"
                   minWidth="955" minHeight="600"
                   backgroundColor="#E7E7E7"
                   creationComplete="application1_creationCompleteHandler(event)">
        <s:layout>
            <s:HorizontalLayout horizontalAlign="center" verticalAlign="middle"/>
        </s:layout>
        <fx:Script>
            <![CDATA[
                import mx.collections.XMLListCollection;
                import mx.events.FlexEvent;
                protected function application1_creationCompleteHandler(event:FlexEvent):void
                    testGrid.dataProvider = new XMLListCollection(testData.item);
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="testData" xmlns="">
                <items>
                    <item>
                        <id>1</id>
                        <cognome>Gabriele</cognome>
                        <nome>Genta</nome>
                        <uhm>5</uhm>
                        <bene>molto</bene>
                    </item>
                    <item>
                        <id>10</id>
                        <cognome>Pinco</cognome>
                        <nome>Pallino</nome>
                        <uhm>10</uhm>
                        <bene>poco</bene>
                    </item>
                </items>
            </fx:XML>
            <fx:Component className="MyDefaultEditor">
                <s:DefaultGridItemEditor>
                    <fx:Script>
                        <![CDATA[
                            import mx.collections.ICollectionView;
                            import mx.collections.ISort;
                            override public function save():Boolean
                                if (!validate())
                                    return false;
                                var newData:Object = value;
                                var property:String = column.dataField;
                                var data:Object = data;
                                var typeInfo:String = "";
                                for each(var variable:XML in describeType(data).variable)
                                    if (property == [email protected]())
                                        typeInfo = [email protected]();
                                        break;
                                if (typeInfo == "String")
                                    if (!(newData is String))
                                        newData = newData.toString();
                                else if (typeInfo == "uint")
                                    if (!(newData is uint))
                                        newData = uint(newData);
                                else if (typeInfo == "int")
                                    if (!(newData is int))
                                        newData = int(newData);
                                else if (typeInfo == "Number")
                                    if (!(newData is Number))
                                        newData = Number(newData);
                                else if (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, turn off the sort for the edited data.
                                    var sort:ISort = null;
                                    if (dataGrid.dataProvider is ICollectionView)
                                        var dataProvider:ICollectionView = ICollectionView(dataGrid.dataProvider);
                                        if (dataProvider.sort)
                                            sort = dataProvider.sort;
                                            dataProvider.sort = null;
                                    var oldData:Object = data[property];
                                    data[property] = newData;
                                    dataGrid.dataProvider.itemUpdated(data, property, oldData, newData);
                                    // Restore the sort. The data will not be sorted due to this change.
                                    if (sort)
                                        ICollectionView(dataGrid.dataProvider).sort = sort;
                                return true;
                        ]]>
                    </fx:Script>               
                </s:DefaultGridItemEditor>
            </fx:Component>
        </fx:Declarations>
        <s:DataGrid id="testGrid" width="100%" height="100%"
                    editable="true" selectionMode="singleCell"
                    itemEditor="{new ClassFactory(MyDefaultEditor)}">
            <s:columns>
                <s:ArrayList>
                    <s:GridColumn headerText="Prova" dataField="cognome"/>
                    <s:GridColumn headerText="Prova1" dataField="nome"/>
                    <s:GridColumn headerText="Prova3" dataField="uhm"/>
                    <s:GridColumn headerText="Prova4" dataField="bene"/>
                </s:ArrayList>
            </s:columns>
        </s:DataGrid>
    </s:Application>

  • Column stretch event in spark datagrid

    Hi everybody,
    These days I'm converting our Flex application from Flex 3 SDK to Flex 4.5 SDK (Hero).
    I've a problem with the spark datagrid, and more specifically, the events listening on the columns.
    How can we know that the columns in the spark datagrid are stretched or shrinked?
    In Flex 3, there was a DataGridEvent.COLUMN_STRETCH event on the datagrid and I can't find the equivalent in Flex 4.5.
    If you have any tips.... thanks!!!!

    When a GridColumn is interactively resized "widthChanged" events are dispatched because the column's width property is set.   To track the entire column separator press-drag-release gesture you can listen for GridEvent.SEPARATOR_MOUSE_DOWN,SEPARATOR_MOUSE_DRAG, etc..events on the DataGrid's columnHeaderGroup skin part.   If you wanted to change the way the interactive column resizing works you'd have to subclass DataGrid and override protected methods like separator_mouseDownHandler(event:GridEvent), separator_mouseDragHandler(event:GridEvent).
    - Hans

  • Drag selection in spark datagrid?

    Is there an easy way to enable a spark DataGrid to use drag selection, similar to how you can select cells in Excel or Google Docs? Or will I need to track mouse movements and manually manipulate the selectedCells?
    Thanks!
    -Aaron

    Couldn't find a built in way to do this, but it turned out to be pretty easy thanks to the GridEvent classes that solve the challenge of know what row/column index the mouse is interacting with. My final solution:
    A class that extends spark::DataGrid
    private var _allowDragSelection:Boolean = false;
    private var dragSelectionAnchor:CellPosition;
    private var dragSelectionStarted:Boolean;
    * If true and selectionMode is GridSelectionMode.MULTIPLE_CELLS the user can drag their
    * mouse to select a rectangular area of cells, just like Excel or Google Docs.
    public function get allowDragSelection():Boolean { return this._allowDragSelection; }
    public function set allowDragSelection(value:Boolean):void {
              if(this._allowDragSelection == value)
                        return;
              this._allowDragSelection = value;
              if(this.allowDragSelection)
                        this.addEventListener(GridEvent.GRID_MOUSE_DOWN, this.handleGridMouseDown);
              else
                        this.removeEventListener(GridEvent.GRID_MOUSE_DOWN, this.handleGridMouseDown);
    private function handleGridMouseDown(e:GridEvent):void {
              if(this.selectionMode != GridSelectionMode.MULTIPLE_CELLS)
                        return;
              this.dragSelectionAnchor = new CellPosition(e.rowIndex, e.columnIndex);
              this.dragSelectionStarted = false;
              this.addEventListener(GridEvent.GRID_MOUSE_DRAG, this.handleGridMouseDrag);
              this.stage.addEventListener(MouseEvent.MOUSE_UP, this.handleDragMouseUp);
    private function handleGridMouseDrag(e:GridEvent):void {
              // don't start processing selection drag until mouse has left the selection anchor
              if(!this.dragSelectionStarted && e.rowIndex == this.dragSelectionAnchor.rowIndex && e.columnIndex == this.dragSelectionAnchor.columnIndex)
                        return;
              // once started, process changes even if the user drags back over the anchor
              this.dragSelectionStarted = true;
              // local to avoid expensive getter cost
              const selectedCells:Vector.<CellPosition> = e.grid.selectedCells;
              // determine the selection rectangle from the anchor to the current cell
              const rowFromIndex:int = Math.min(this.dragSelectionAnchor.rowIndex, e.rowIndex);
              const rowToIndex:int = Math.max(this.dragSelectionAnchor.rowIndex, e.rowIndex);
              const colFromIndex:int = Math.min(this.dragSelectionAnchor.columnIndex, e.columnIndex);
              const colToIndex:int = Math.max(this.dragSelectionAnchor.columnIndex, e.columnIndex);
              // create new cell positions selection vector, and track if any new cell is added
              var cells:Vector.<CellPosition> = new Vector.<CellPosition>();
              var cellsChanged:Boolean = false;
              for(var row:int = rowFromIndex; row <= rowToIndex; row++){
                        for(var col:int = colFromIndex; col <= colToIndex; col++){
                                  var cell:CellPosition = new CellPosition(row, col);
                                  cells.push(cell);
                                  cellsChanged = cellsChanged || !selectedCells.some(function(c:CellPosition, i:int, v:Vector.<CellPosition>):Boolean {
                                            return c.rowIndex == cell.rowIndex && c.columnIndex == cell.columnIndex;
              // assign the new selection only if it changed (Flex is pretty slow here with big selections)
              if(cellsChanged || selectedCells.length != cells.length){
                        this.selectedCells = cells;
                        // maintain the selection anchor for any following SHIFT click selection
                        this.grid.anchorRowIndex = rowFromIndex;
                        this.grid.anchorColumnIndex = colFromIndex;
    private function handleDragMouseUp(e:MouseEvent):void {
              this.removeEventListener(GridEvent.GRID_MOUSE_DRAG, this.handleGridMouseDrag);
              this.stage.removeEventListener(MouseEvent.MOUSE_UP, this.handleDragMouseUp);
    Cheers.
    -Aaron

  • How do I get itemDoubleClick event in spark DataGrid ???

    Hello Everyone,
    Recently I am working with Spark DataGrid.
    Before I was using AdvancedDataGrid. In that I was capturing itemDoubleClick event.
    But I am not able to find such a event in SparkdataGrid.
    So I want to capture double click event on single row of DataGrid.
    Some people told that, I have to use my custom ItemRenderer to do that.
    But is there any way to capture itemDoubleClick event in Spark DataGrid without creating custom ItemRenderer ???

    You are correct.  I looked a the code and the comment says it dispatches a double click if the 2nd click is within the  DOUBLE_CLICK_TIME even if the first click was on another cell.
    This code figures out if the double-click is a true double-click.
    <?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">
        <fx:Script>
            <![CDATA[
                import spark.events.GridEvent;
                private var lastColumnIndex:int = -1;
                private var lastRowIndex:int = -1;
                // set this to change the double click time   
                //mx_internal::event.grid.DOUBLE_CLICK_TIME = 480;  // ms
                protected function dataGrid_gridClickHandler(event:GridEvent):void
                    trace("click on this cell", event.rowIndex, event.columnIndex);
                    lastRowIndex = event.rowIndex;
                    lastColumnIndex = event.columnIndex;
                protected function dataGrid_gridDoubleClickHandler(event:GridEvent):void
                   if (event.rowIndex == lastRowIndex && event.columnIndex == lastColumnIndex)
                       trace("a real double click on this cell", event.rowIndex, event.columnIndex);
                   else
                       trace("this is a gridClick on another cell", event.rowIndex, event.columnIndex);
                   lastRowIndex = event.rowIndex;
                   lastColumnIndex = event.columnIndex;
            ]]>
        </fx:Script>
            <s:DataGrid id="dataGrid" requestedRowCount="5" verticalCenter="0" horizontalCenter="0"
                         doubleClickEnabled="true"
                          gridClick="dataGrid_gridClickHandler(event)"
                          gridDoubleClick="dataGrid_gridDoubleClickHandler(event)">
                <s:ArrayCollection>
                    <s:DataItem key="1000" name="Abrasive" price="100.11" call="false"/>
                    <s:DataItem key="1001" name="Brush" price="110.01" call="true"/>
                    <s:DataItem key="1002" name="Clamp" price="120.02" call="false"/>
                    <s:DataItem key="1003" name="Drill" price="130.03" call="true"/>
                    <s:DataItem key="1004" name="Epoxy" price="140.04" call="false"/>
                    <s:DataItem key="1005" name="File" price="150.05" call="true"/>
                    <s:DataItem key="1006" name="Gouge" price="160.06" call="false"/>
                    <s:DataItem key="1007" name="Hook" price="170.07" call="true"/>
                    <s:DataItem key="1008" name="Ink" price="180.08" call="false"/>
                    <s:DataItem key="1009" name="Jack" price="190.09" call="true"/>            
                </s:ArrayCollection>
            </s:DataGrid>
    </s:Application>

  • [Flex 4.5.1] How to prevent Radio Button from being selected when clicked on? No Changing Event?

    I have a very common use case where you have a few radio buttons and only one can be selected at a time. Some of them are basic and on click should be selected right away, but other are more complex and open a pop up which requires some additional user selections after which the user selected OK or CANCEL for example and only after that the selection of the radio button should be applied programatically.
    So to solve this issue I've come up with 2 workarounds:
    1) make the entire group, that holds the radio button, act as a button with buttonMode="true" mouseChildren="false" and programatically change the radio button within it.
    2) hold the current radio button selection in a variable and in the changeHandler of that radio button return the selection back to what was selected before. But this also causes a small flickering of the radio button which gets selected and deselected immediately after that.. not cool.
    So my question is... is there something I am missing that could do the job without these workarounds... like a Changing event which I use for the ButtonBar but I can't find on the RadioButton or RadioButtonGroup... thanks!

    Hi,thanks for the reply. Actually that was my third option, but not sure if it's very good also..
    Here is a simple scenario:
    User must select between 2 radio buttons:
    1) no volume -> sets variable volume=0 and selects the radio button (that is the normal use case)
    2) set volume -> opens up a pop up with a list that has a X button to close and 4 options: 25% volume, 50% volume, 75%, 100%
    At this point the set volume radio button should not be selected and the user has 2 choices:
    -> hit the X button to close - nothing changes and no volume radio button is still selected and volume is still = 0
    -> hit one of the volume % buttons -> the set volume radio button gets selected and the variable volume=25/50/75/100 depending on the button selected by the user.
    That's a pretty common scenario and it's bugging me that I can't easily alter the radio button selection logic since whenever I click it, it gets selected and I can't put a logic in between in a standard way. This should apply to any component with selection, just like ButtonBar has it with the Changing event.
    So is there any other more convenient way to accomplish this scenario that you could recommend?
    Thanks!

  • How to change header font style in Spark DataGrid?

    I'm looking since last week for a way how to change the font style of the header in a Spark DataGrid. It drive me nuts that I can't find a way to do this. Have anyone one an idea how to achieve it? Any help is appreciated.
    Thanks,
    - Artur

    Hi,
    Some styles won't work because some text styles got hardcoded into the DefaultGridHeaderRenderer's Label. You'll run into this issue not just with the DataGrid headers but also things like the Panel's title and other places where we have text. One way to get around this issue is to create your own custom headerRenderer based on the default one and then redefine the headerRenderer skin part in the skin.
    First, create a subclass of the DefaultGridHeaderRenderer and tweak the "labelDisplay" to your liking (or even just take out all the styles and style it on your own as you had earlier using your custom header renderer's name). Example below (I named it "CustomHeaderRenderer"):
    <?xml version="1.0" encoding="utf-8"?>
    <skins:DefaultGridHeaderRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                                     xmlns:s="library://ns.adobe.com/flex/spark"
                                     xmlns:mx="library://ns.adobe.com/flex/mx"
                                     xmlns:skins="spark.skins.spark.*"
                                     xmlns:comps="comps.*">
        <fx:Declarations>
            <!-- Remove fontweight="bold" and other styles as you wish
                 Must be a component and not a factory. -->
            <s:Label id="labelDisplay"
                     verticalCenter="1" left="0" right="0" top="0" bottom="0"
                     textAlign="start"
                     verticalAlign="middle"
                     maxDisplayedLines="1"
                     showTruncationTip="true" />
        </fx:Declarations>
    </skins:DefaultGridHeaderRenderer>
    Next, create a simple DataGrid skin by creating a subclass of the  spark.skins.spark.DataGridSkin in MXML and defining a new headerRenderer  component in the fx:Declarations section. Example below (I named it "CustomDataGridSkin"):
    <?xml version="1.0" encoding="utf-8"?>
    <skins:DataGridSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/mx"
                    xmlns:skins="spark.skins.spark.*"
                    xmlns:comps="comps.*">
        <fx:Declarations>
            <!-- Must be a factory with the right id for the skin part -->
            <fx:Component id="headerRenderer">
                <comps:CustomHeaderRenderer />
            </fx:Component>
        </fx:Declarations>
    </skins:DataGridSkin>
    Last, assign your new skin as the skinClass of your DataGrid (either in MXML or as a style):
    <s:DataGrid skinClass="comps.CustomDataGridSkin">
    I know it's not pretty, but it's the result of trading off between having completely custom skinning vs. having knobs to tweak every style. Hope this helps.
    -Kevin

  • Best way to mark data that has changed when it is edited in  a spark datagrid?

    I am not sure if this is the best way to mark data that has changed (isModifiedClientSide ) when it is edited in  a spark datagrid:
    <GridColumn  width="140" headerText="Margin "dataField="margin" editable="false"  editable.editMode="true"  >
                        <itemRenderer>
                            <fx:Component>
                                <DefaultGridItemRenderer textAlign="right"   background="true" backgroundColor="#ffffff"  alpha="1.0" color="#000000" >
                                    <focusOut>
                                        <![CDATA[
                                        this.data.isModifiedClientSide = 1;
                                        ]]>
                                    </focusOut>
                                </DefaultGridItemRenderer>
                            </fx:Component>
                        </itemRenderer>
                    </GridColumn>

    I tried this but the value commit doesnt't get fired bro:
        <GridColumn  width="140" headerText="Margin (disabled)" headerText.editMode="Margin (editing)" dataField="margin" editable="false"  editable.editMode="true"  >
                        <itemEditor>
                            <fx:Component>
                                <DefaultGridItemEditor>
                                    <valueCommit>
                                        <![CDATA[
                                        this.data.isModifiedClientSide = 1;
                                        ]]>
                                    </valueCommit>
                                </DefaultGridItemEditor>
                            </fx:Component>
                        </itemEditor>
                    </GridColumn>
    what do you think?

  • Selecting cells and rows in the Spark DataGrid control

    This question was posted in response to the following article: http://help.adobe.com/en_US/flex/using/WS0ab2a460655f2dc3-427f401412c60d04dca-7ff8.html

    "Note: While the selectedCells, selectedIndices, and selectedItems properties are all writable, Adobe recommends that you use methods of the DataGrid to change selection programmatically."
    OK.. So how do I programmatically select multiple items?
    The setSelectedIndex method will only add a single item.
    I have tried to ''push" an index onto the selectedIndicies but that won't work either...
    Please help me.. this is driving me nuts...

  • Textinput change event is not firing in datagrid

    Hi frnds
                    i am using simple datagrid in which textinput is rendered  in one column of grid.i want to apply dateformatter on that textinput for this i call a function on change event of that textinput but surprisingly change event is not occuring on textInput.can anybody please guide me how to fire change event of rendered textinput. or is there any way to apply dateformmter on datagrid's textinput rendrer.
    Thanks in advance
       Vineet osho

    Use a labelFunction that calls the dateFormatter

  • How to add selection event, change event and click event for dropdownlist for mobile applications

    Please someone help me in writng selection , click and change events for dropdownlist in flex for mobile applications . i have tried but i wasn't able to select the items in dropdown using my mouse or touch in my mobile . Please help me I am struck at this point and i am unable to get solution gfor this. Please................
    Some code for which i neederd help:
    <s:DropDownList id="ddlBranch" x="257" y="475" width="63%" height="80%"
                                    creationComplete="ddlBranch_creationCompleteHandler(event)"
                                    fontFamily="Calibri" fontSize="24"
                                    labelField="BranchName"
                                    prompt="{ddlBranch.selectedItem}"
                                    requireSelection="true"
                                    selectionColor="#7ab342">
                        <s:AsyncListView list="{getBranchResult.lastResult}"/>
                    </s:DropDownList>
    <s:DropDownList id="ddlZone" x="257" y="546" width="63%" height="80%"
                                    creationComplete="ddlZone_creationCompleteHandler(event)"
                                    fontFamily="Calibri" fontSize="24"
                                    labelField="ZoneName"
                                    prompt="{ddlZone.selectedItem}"
                                    requireSelection="true"
                                    selectionColor="#7ab342">
                        <s:AsyncListView list="{getZoneResult.lastResult}"/>
                    </s:DropDownList>
    I will get the list of Branches(first DDL) and Zones(Second DDL) from a webservice written in DOT(.)NET,  what i needded is touch events and selection events for both the dropdown lists and the data in the second DropDown List should bind based on the First Dropdown list item selected.
    Service call for binding data to DDL:
    protected function ddlBranch_creationCompleteHandler(event:FlexEvent):void
                    getBranchResult.token = loginService.getBranch();
                protected function ddlZone_creationCompleteHandler(event:FlexEvent):void
                    getZoneResult.token = loginService.getZone();
    Please help...
    Thank you.

    Therer are two ways you can assign an action to the "OnEnter"-event of your input field:
    1. in method cl_wd_input_field=>new_input_field you have the parameter:
    ON_ENTER
    You just have to assign your action name to this field and it will be called on the OnEnter-event of your InputField.
    e.g:
         lr_input_field = cl_wd_input_field=>new_input_field(
                                                 id = 'INP_MY_INPUT_FIELD'
                                                 on_enter = 'MYACTION'
    2. You can use the method SET_ON_ENTER.
    like:
         lr_input_field->set_on_enter( 'MYACTION' ).
    Just make sure, you have created and implemented this action and its handler.

Maybe you are looking for

  • Business Objects and underlying technology

    Post Author: kar CA Forum: Deployment Hi, We are using Business Objects 6.5. We are in  the process of automating testing on Business Objects reports.We are planning to use Rational Functional Tester.Here comes the problem.RFT doesn't recognise any o

  • Windows Compatibility Issue (?)

    I cannot open iTunes with Windows 7 Ultimate Service Pack 1; I have uninstalled and reinstalled iTunes, I have unchecked to run in compatibility mode, and I have run iTunes troubleshooting, but continue to get "incompatible application detected".  I

  • Cannot move/drag windows

    I don't know what happened but it seems all my windows are locked up. I cannot move any window around by dragging. I can only minimize or maximise the window, nothing else. this is crazy and is driving me nuts. i'm running 10.9.3 on mid 2010 mbp. hop

  • Import Configuration error

    Hello I have created a new software component, product as well. Created a new development track for the same. Addedd all the needed dependencies as well. However when i try importing the same into NWDS via import configuration I get the following err

  • Tomahawk tree2 not rendered properly in mobile browser

    Hi, I was trying to use tomahawk tree2 component. It was able to render properly on the desktop browser. I tried to open the same application on the PDA IE browser. There is a gap between the nodes. It was not looking good. How can i apply my own sty