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...

Similar Messages

  • Selecting an entire row with the help of Checkbox

    Hi and Evening to Everybody,
    I have a Scenario where i need to select an entire row using the check box. Let me first define the Situation. I created a Simple Sql-report where the first column is a Simple Checkbox and the second column is a display only name and followed by the rest 5 columns as a checkbox.
    my table structure is :
    **create table satt (SELECT_ALL VARCHAR2(10), Name VARCHAR2(50), Object1 VARCHAR2(10), Object2 VARCHAR2(10), Object3 VARCHAR2(10), Object4 VARCHAR2(10), Object5 VARCHAR2(10));**
    Now i had a requirement where i need to Check All or Uncheck All Checkbox by clicking SELECT_ALL column header and i made it using
    simple java-script :
    "<input type="Checkbox" onclick="$f_CheckFirstColumn(this)">"
    Now i need to Check all checkbox in a row by clicking any of the SELECT_ALL check boxes. (Say i have 5 checkboxes in SELECT_ALL column and if i click 3rd checkbox... i need the entire 3rd row checkbox to be checked on click of that 3rd check box).
    I hope i was clear with my question. i did my best. Please help me out with this... Im eagerly lookin for the solutions.
    Thanks & Regards,
    - The Beginner.
    Edited by: 854477 on Jul 13, 2011 4:57 AM
    Edited by: 854477 on Jul 13, 2011 5:01 AM

    Solomon Yakobson wrote:
    There is no row order in relational tables unless ORDER BY is used, so there is no way to decide if 3 Mathematics belongs to 100 or to 200.
    SY.That's not how I interpretted it. I thought he was saying that in the first row column B has the value:
    '1 Physics'||chr(10)||'2 Chemistry'||chr(10)||'3 Mathematics'
    in which case something like this would work
    select a,replace(b,chr(10),chr(10)||a||' ') from table;

  • Playing with the spark datagrid

    I'm Playing with the spark datagrid and have a column set up like so:
    <GridColumn  width="140" headerText="Margin" headerText.editMode="Margin (editing)" dataField="margin" editable="false"  editable.editMode="true" itemRenderer="gridColumnRenderer" >
               </GridColumn>
    I would like the item render to change colour based on the state of the outerDocuent, is this possible?
    I tried this but can't get to the outerdocument
    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/mx"
                    autoDrawBackground="true">
        <s:Label text="{data.margin}" backgroundColor="{   outerDocument.currentState =='editMode'?0xffffff:0xdddddd}"/>
    </s:ItemRenderer>

    I believe you will need to use GridItemRenderer instead of ItemRenderer as your base class for renderers in the spark DataGrid.  Does it work if you change to that?

  • Columns, cells and row headings

    My printer continues to print column headings, cells and row headings even though none of these boxes are checked under the Appleworks (6.2.9) pull down menu

    Welcome to Apple Discussions
    When an application stops working as it should, it's likely due to corrupt preferences. You can follow the steps in this user tip or use the reset function of Dale Gillard's Sidekick.

  • Urgent :  how to select the rows in the ALV Grid Control

    How to select the rows in the ALV Grid control,
    I am facing the situation where i need to select the row/rows in the Grid control and then to lock the entries,
    If anyone have the solution please help me out
    <b>Its very Urgent</b>

    Hi Bharath,
    Go through this hope u can understand.
    SEL_MODE. Selection mode, determines how rows can be selected. Can have the following values:
    A Multiple columns, multiple rows with selection buttons.
    B Simple selection, listbox, Single row/column
    C Multiple rows without buttons
    D Multiple rows with buttons and select all ICON
    Setting and getting selected rows (Columns) and read line contents
    You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows and set_selected_rows. There are similar methods for columns.
    Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected row(s) to read the information in the rows from the table. In the examples below the grid table is named gi_sflight.
    Data declaration:
    DATA:
    Internal table for indexes of selected rows
    gi_index_rows TYPE lvc_t_row,
    Information about 1 row
    g_selected_row LIKE lvc_s_row.
    Example 1: Reading index of selected row(s) and using it to read the grid table
      CALL METHOD go_grid->get_selected_rows
        IMPORTING
          et_index_rows = gi_index_rows.
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines = 0.
        CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
             EXPORTING
                  textline1 = 'You must choose a valid line'.
        EXIT.
      ENDIF.
      LOOP AT gi_index_rows INTO g_selected_row.
         READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
        ENDIF.
      ENDLOOP.
    Example 2: Set selected row(s).
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines > 0.
        CALL METHOD go_grid->set_selected_rows
            exporting
              it_index_rows = gi_index_rows.
      ENDIF.
    Reward points if helpful.
    Thanks
    Naveen khan

  • How to handle multiple selection in the Spark List control with checkbox as itemrenderer?

    Hi All,
    I am using checkbox as an ItemRenderer in spark list.
    I have a query.
    how to handle multiple selection in the Spark List control with checkbox as itemrenderer?
    how to retrieve the selected item label?
    Thank you in advance.

    Hi there, I'll tweak your code a little bit to something like this:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    layout="vertical">
        <mx:Script>
            <![CDATA[
                 import mx.events.ListEvent;
                 import mx.controls.CheckBox;
               [Bindable]
               private var mySelectedIndexes:ArrayCollection=new ArrayCollection();
                private function onChange(e:ListEvent):void
                   if(CheckBox(e.itemRenderer).selected){
                             mySelectedIndexes.addItem(e.rowIndex);
                   }else{
                                  mySelectedIndexes.removeItemAt(mySelectedIndexes.getItemIndex(e.rowIndex));     
                   chkList.selectedIndices=mySelectedIndexes.toArray();
            ]]>
        </mx:Script>
    <mx:ArrayCollection id="collection">
            <mx:Object label="Test A"/>
            <mx:Object label="Test B"/>
            <mx:Object label="Test C"/>
            <mx:Object label="Test D"/>
            <mx:Object label="Test E"/>
            <mx:Object label="Test F"/>
            <mx:Object label="Test G"/>
        </mx:ArrayCollection>
    <mx:List id="chkList" dataProvider="{collection}" itemRenderer="mx.controls.CheckBox"  itemClick="onChange(event);" allowMultipleSelection="true"/>
    </mx:Application>

  • Item availability for selected items and directly create the delivery

    Hi All,
    For a very big sales order ..lets say having 700 line items ...is there any convenient way to create the delivery for selected items ..e.g. 30-40 line items rather going and selecting the line items then doing the item availability.
    do you have any LSMW format by which we can do the item availability for selected items and directly create the delivery.
    kindly Guide me..
    With Regards
    Azeez.Mohd

    Hi ,
    There is no stand way of doing it . You need to take help of abaper to do this :
    1. Create a t code where if you give sale order number , it displays a report with all the items with a check box near to it as we see in SE16 .
    2. This report could be best in ALV form where users can do "ctr+f" and search only the required materials then select those lines and press a button on the top of report .
    3. Once the button is pressed , program will run vL01n ( create delv in backgrnd) in a BDC form . At time of delev creating , the bdc program in backgrnd uses only those items which were selected by user and not the other items .
    4. Program will create a delv using a BDC in background and return the delv number for user to view tht.
    U can also try using FM : RV_DELIVERY_CREATE to create delv in backgrnd after user selection if BDC is getting tricky.
    Hopefully ,this shuld work and will be a easy process for the customers.
    Let us know the outcome .. .
    B O L ..
    Hope this Helps !!!

  • Select, Copy and Paste text - the iPhone can't do that either???

    Select, Copy and Paste text - the iPhone can't do that either??? OK, this is pretty lame...the iPhone does not allow you to select, copy or paste text in SMS, Notes, Safari or Mail. Is this just a oversight on the part of Apple?

    Apple left out a LOT of basic functionality from the iPhone. I think they believe that the 'sexiness factor' will far outweigh the need for functionality in getting this phone to sell. For the most part they were right. Now that most of us have realized what this phone cannot do, and that the honeymoon is over (well, for the most part) I hope that Apple will do include some of that basic functionality in future updates. I also hope that the 3G phone is not the answer to this because that will leave out a lot of users who want these basic features but who dont really want 3G.

  • I use "element 12" and want  like in the old PS version due Automating and Contact  II upload multiple filesand print them with any columns and rows on the same page . How does it work?

    I use "element 12" and want  like in the old PS version due Automating and Contact  II upload multiple filesand print them with any columns and rows on the same page . How does it work?

    Can you supply a link?

  • JPGS are set to open in Photoshop Elements, but they open in Windows Photo Viewer instead, even when I specifically select Photoshop (and it's the default app)

    JPGS are set to open in Photoshop Elements, but they open in Windows Photo Viewer instead, even when I specifically select Photoshop (and it's the default app)

    Hi,
    It seems this is a Microsoft related. You are referring on how to set JPG Image in Photoshop Elements by default. You may try visiting Microsoft's Support page http://support.microsoft.com/ for you to get the correct information/help you need.
    Thank you.

  • After loading the internet using Firefox AND then selecting NEWS and a delay the Error "The MSN toolbar has encountered an error. etc" occurs. Also, when browsing some searches are "REDIRECTED"!

    After loading the internet using Firefox AND then selecting NEWS and a delay the Error "The MSN toolbar has encountered an error. etc" occurs. Also, when browsing some searches are "REDIRECTED"!
    == This happened ==
    Every time Firefox opened
    == Hard to say but have been trying to diagnose for at least a week.

    Original message wouldnt post with attachments - trying again....
    Attachments:
    secondclickheredialog.jpg ‏40 KB
    FirstDialog.jpg ‏19 KB
    Firstclickheredialog.jpg ‏16 KB

  • What is the point of [Bindable("selectionChange")] in parts of the spark datagrid class?

    I dont understand the point of this code in the spark datagrid class:
    what is the point of this:
        [Bindable("selectionChange")]
         [Bindable("valueCommit")]
         [Inspectable(category="General", defaultValue="null")]
    in
        //  selectedItem
        [Bindable("selectionChange")]
        [Bindable("valueCommit")]
        [Inspectable(category="General", defaultValue="null")]
         *  @copy spark.components.Grid#selectedItem
         *  @default null
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 2.5
         *  @productversion Flex 4.5
        public function get selectedItem():Object
            if (grid)
                return grid.selectedItem;
            return (dataProvider && (selectedIndex > 0)) ?
                dataProvider.getItemAt(selectedIndex) : undefined;
         *  @private
        public function set selectedItem(value:Object):void
            if (grid)
                grid.selectedItem = value;
            else
                var f:Function = function(g:Grid):void
                    g.selectedItem = value;
                deferredGridOperations.push(f);

    Anything that is binding to selectedItem will go get the value again when either of those events fires.

  • Windows installer package not running or installing properly error when i try to install and update to the new icloud control panel.

    i get a windows installer package not running or installing properly error when i try to install and update to the new icloud control panel.

    Okay ... so it's not one of the cases of bodged up ACLs on the Apple folder in Common Files. (That's been underlying a few of the recalcitrant E7W5s.
    Just in case, let's try the fixit from the following document:
    Fix problems with programs that can't be installed or uninstalled

  • How to get the current selected column and row

    Hi,
    A difficult one, how do i know which column (and row would also be nice) of a JTable is selected?
    e.g.
    I have a JButton which is called "Edit" when i select a cell in the JTable and click the button "Edit" a new window must be visible as a form where the user can edit the a part of a row.
    Then the column which was selected in the JTable must be given (so i need to know current column) and then i want the TextField (the one needed to be edited) be active with requestFocus(). So it would be
    pricetextfield.requestFocus();
    Problem now is that i have to click every time in the window the JTextField which was selected in the JTable. I have chosen for this way of editing because my application is multi-user and it would be too difficult for me when everybody did editing directly (catch signals, reload data, etc.).
    My question is how do I know the current column and the current row in a JTable?

    I'm not sure what your mean by the "current" row or column, but the following utility methods return
    which row and column have focus within the JTable.
    public static int getFocusRow(JTable table) {
        return table.getSelectionModel().getLeadSelectionIndex();
    public static int getFocusColumn(JTable table) {
        return table.getColumnModel().getSelectionModel().getLeadSelectionIndex();
    }

  • Merge multiple cells and rows

    Hello,
    I am trying to merge multiple cells and have found that I can do thi easily by selecting the adjancent row cells and using the TABLE - MERGE CELLS command.  However, If I want to apply the same merge to multiple rows, I can find noquick way to do this other than selecting each set of cells and using the TABLE - MERGE CELLS command each time.  Here is an example of what I want to do:
    Here is the Numbers spreadsheet as normal:
    Here is cell B2 and C2 merged:
    Now what I want to do is the same process for rows 3 to 10.  However, when I try to select the section and use the TABLE - MERGE CELLS command, I get on large cell rather than split rows of merged cells as seen below:
    Any idea how I can or if I can accomplish this task?
    Thanks in advance,
    OriginalGumshoe

    You may also use this script :
    --{code}
    --[SCRIPT merge_row_by_row]
    Enregistrer le script en tant que Script : merge_row_by_row.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Bibliothèque:Scripts:Applications :Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Sélectionner le bloc de cellules à traiter.
    Aller au menu Scripts , choisir Numbers puis choisir “merge_row_by_row”
    Le script fusionne les cellules de chaque ligne appartenant à la sélection.
    --=====
    L’aide du Finder explique:
    L’Utilitaire AppleScript permet d’activer le Menu des scripts :
    Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case “Afficher le menu des scripts dans la barre de menus”.
    Sous 10.6.x,
    aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
    puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
    --=====
    Save the script as a Script: merge_row_by_row.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Select the range of cells to treat
    Go to the Scripts Menu, choose Numbers, then choose “merge_row_by_row”
    The script merge the cells of every row included in the selection.
    --=====
    The Finder’s Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the “Show Script Menu in menu bar” checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/12/18
    --=====
    on run
              local dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2, r
              my activateGUIscripting()
              set {dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
              tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
                        repeat with r from rowNum1 to rowNum2
                                  set selection range to range (name of cell colNum1 of row r & " : " & name of cell colNum2 of row r)
                                  my selectmenu("Numbers", 6, 23) -- Merge cells
                        end repeat
              end tell
    end run
    --=====
    set { dName, sName, tName,  rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    on get_SelParams()
              local d_Name, s_Name, t_Name, row_Num1, col_Num1, row_Num2, col_Num2
              tell application "Numbers" to tell document 1
                        set d_Name to its name
                        set s_Name to ""
                        repeat with i from 1 to the count of sheets
                                  tell sheet i to set maybe to the count of (tables whose selection range is not missing value)
                                  if maybe is not 0 then
                                            set s_Name to name of sheet i
                                            exit repeat
                                  end if -- maybe is not 0
                        end repeat
                        if s_Name is "" then
                                  if my parleAnglais() then
                                            error "No sheet has a selected table embedding at least one selected cell !"
                                  else
                                            error "Aucune feuille ne contient une table ayant au moins une cellule sélectionnée !"
                                  end if
                        end if
                        tell sheet s_Name to tell (first table where selection range is not missing value)
                                  tell selection range
                                            set {top_left, bottom_right} to {name of first cell, name of last cell}
                                  end tell
                                  set t_Name to its name
                                  tell cell top_left to set {row_Num1, col_Num1} to {address of its row, address of its column}
                                  if top_left is bottom_right then
                                            set {row_Num2, col_Num2} to {row_Num1, col_Num1}
                                  else
                                            tell cell bottom_right to set {row_Num2, col_Num2} to {address of its row, address of its column}
                                  end if
                        end tell -- sheet…
                        return {d_Name, s_Name, t_Name, row_Num1, col_Num1, row_Num2, col_Num2}
              end tell -- Numbers
    end get_SelParams
    --=====
    on parleAnglais()
              local z
              try
                        tell application "Numbers" to set z to localized string "Cancel"
              on error
                        set z to "Cancel"
              end try
              return (z is not "Annuler")
    end parleAnglais
    --=====
    on decoupe(t, d)
              local oTIDs, l
              set oTIDs to AppleScript's text item delimiters
              set AppleScript's text item delimiters to d
              set l to text items of t
              set AppleScript's text item delimiters to oTIDs
              return l
    end decoupe
    --=====
    on activateGUIscripting()
      (* to be sure than GUI scripting will be active *)
              tell application "System Events"
                        if not (UI elements enabled) then set (UI elements enabled) to true
              end tell
    end activateGUIscripting
    --=====
    my selectMenu("Pages",5, 12)
    ==== Uses GUIscripting ====
    on selectmenu(theApp, mt, mi)
      activate application theApp
              tell application "System Events" to tell application process theApp to tell menu bar 1 to ¬
                        tell menu bar item mt to tell menu 1 to click menu item mi
    end selectmenu
    --=====
    --[/SCRIPT]
    --{code}
    Yvan KOENIG (VALLAURIS, France) dimanche 18 décembre 2011 22:21:24
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

Maybe you are looking for

  • A Pages document will not open.  Others do, but are slow.  Need this document!

    A Pages document will not open and there is a screen annoucement it will not open.  Other Pages documents do open, but are slow.  The one that will not open now was also very slow.  My last visit to the Apple store the Genius Bar said I needed a new

  • Content related to Workflow

    Here i would like to see contents related to the workflow as that is one of the hot cake of Enterprise Solution. If any one one has some good document for that then it will be very nice for all. Regards, amit

  • Custom View in Designers Rollup Header from Lookup Field

    Hi! I have a task list that is rolling up a couple of different ways. I'm having some issues getting it to be just right. 1) Rollup display. The rollup is working great except:  My task list is using a lookup field on an list of initiatives. The look

  • Viewing PDF files like epubs

    I was wondering if there is an app out there that allows large pdf files to be viewed the same way say Stanza or another epub reader views books? Right now I have to scroll through the pdf file and I would like to "flip" the pages if I could. Convert

  • WLC IP Conflict with AP-Manager Interface

    I am getting an error log in the WLC saying, its IP address is being used by another machine with MAC address A.B.C.D But this MAC address A.B.C.D is the MAC address of the AP-Manager Interface in the same controller. have anyone faced an issue like