How to add Column to Adobe flex mx:DataGrid in mxml and/or actionsctpt?

I have simple mxml code
<mx:DataGrid id="DGG"
             editable="true">
    <mx:dataProvider>
        <mx:Object scheduledDate="4/1/2006"/>
    </mx:dataProvider>
</mx:DataGrid>
<mx:Button id="SetBut"
           label="Set Array as Data Provider"
           click="SetDP(); AddBut.visible = true;"
           x="100.5"
           y="164"
           width="211"/>
<mx:Button id="AddBut"
           label="Add a column!"
           click="AddCol();"
           x="100.5"
           y="194"
           width="211"
           visible="false"/>
<mx:Script>
    <![CDATA[
        import mx.controls.dataGridClasses.DataGridColumn;
        import mx.collections.ArrayCollection;
        [Bindable]
        public var MyAC:ArrayCollection=new ArrayCollection([{scheduledDate: "4/1/2006", homeTeam: "Chester Bucks"}]);
        public function SetDP():void
            DGG.dataProvider=MyAC
        public function AddCol():void
            MyAC.addItem({scheduledDate: "4/5/2007", homeTeam: "Long Valley Hitters", Umpire: "Amanda Hugenkis"});
            DGG.columns.push(new DataGridColumn("Umpire"));
    ]]>
</mx:Script>
I want to add rows to my table datagrid how to do such thing?
How to add Column to Adobe flex mx:DataGrid in mxml and/or actionsctpt?
(You can put this code in Flash or AIR app - it will compile with no errors, but will not add any columns=( )

Change this:
             public function SetDP():void
                DGG.dataProvider=MyAC
                MyAC.addItem({scheduledDate: "4/5/2007", homeTeam: "Long Valley Hitters", Umpire: "Amanda Hugenkis"});
            public function AddCol():void
                var dgc:DataGridColumn = new DataGridColumn("Umpire");
                var ca:Array = DGG.columns;
                ca.push(dgc);
                DGG.columns = ca;
Dany

Similar Messages

  • How to add column dynamically based on user input in oracle?

    **how to add column dynamically based on user input in oracle?**
    I am generating monthly report based on from_date to to_date below is my requirement sample table
    EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE | 01-OCT-12 | 02-OCT-12 | 03-OCT-12
    100001.............John...........02-OCT-12...............6
    100002.............chris...........01-OCT-12...............4
    Based on user input, that is, if user need the report from 01-OCT-12 TO 03-OCT-12, i need to add that dates as column in my table, like 01-OCT-12 | 02-OCT-12 | 03-OCT-12....
    below is my code
    create or replace
    procedure MONTHLY_LVE_NEW_REPORT_demo
    L_BUSINESS_UNIT IN SSHRMS_LEAVE_REQUEST_TRN.BUSINESS_UNIT%TYPE,
    --L_LEAVE_TYPE_CODE           IN SSHRMS_LEAVE_REQUEST_TRN.LEAVE_TYPE_CODE%TYPE,
    L_DEPARTMENT_CODE IN VARCHAR2,
    --L_MONTH                    IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
    L_FROM_DATE IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
    L_TO_DATE in SSHRMS_LEAVE_REQUEST_TRN.LVE_TO_DATE%type,
    MONTHRPT_CURSOR OUT SYS_REFCURSOR
    AS
    O_MONTHRPT_CURSOR_RPT clob;
    v_return_msg clob;
    BEGIN
    IF (L_BUSINESS_UNIT IS NOT NULL
    AND L_FROM_DATE IS NOT NULL
    and L_TO_DATE is not null
    -- AND L_DEPARTMENT_CODE IS NOT NULL
    THEN
    OPEN MONTHRPT_CURSOR FOR
    select EMPLOYEE_CODE, EMPLOYEE_NAME AS NAME, DEPARTMENT_CODE AS DEPARTMENT,DEPARTMENT_DESC, CREATED_DATE,
    NVL(WM_CONCAT(CL_RANGE),'') as CL_TAKEN_DATE,
    case when NVL(SUM(CL2),0)<0 then 0 else (NVL(SUM(CL2),0)) end as CL_BALANCE,
    from
    SELECT DISTINCT a.employee_code,
    a.EMPLOYEE_FIRST_NAME || ' ' || a.EMPLOYEE_LAST_NAME as EMPLOYEE_NAME,
    a.DEPARTMENT_CODE,
    a.DEPARTMENT_DESC,
    B.LEAVE_TYPE_CODE,
    B.LVE_UNITS_APPLIED,
    B.CREATED_DATE as CREATED_DATE,
    DECODE(b.leave_type_code,'CL',SSHRMS_LVE_BUSINESSDAY(L_BUSINESS_UNIT,to_char(b.lve_from_date,'mm/dd/yyyy'), to_char(b.lve_to_date,'mm/dd/yyyy'))) CL_RANGE,
    DECODE(B.LEAVE_TYPE_CODE,'CL',B.LVE_UNITS_APPLIED)CL1,
    b.status
    from SSHRMS_EMPLOYEE_DATA a
    join
    SSHRMS_LEAVE_BALANCE C
    on a.EMPLOYEE_CODE = C.EMPLOYEE_CODE
    and C.STATUS = 'Y'
    left join
    SSHRMS_LEAVE_REQUEST_TRN B
    on
    B.EMPLOYEE_CODE=C.EMPLOYEE_CODE
    and c.EMPLOYEE_CODE = b.EMPLOYEE_CODE
    and B.LEAVE_TYPE_CODE = C.LEAVE_TYPE_CODE
    and B.STATUS in ('A','P','C')
    and (B.LVE_FROM_DATE >= TO_DATE(L_FROM_DATE, 'DD/MON/RRRR')
    and B.LVE_TO_DATE <= TO_DATE(L_TO_DATE, 'DD/MON/RRRR'))
    join
    SSHRMS_LEAVE_REQUEST_TRN D
    on a.EMPLOYEE_CODE = D.EMPLOYEE_CODE
    and D.LEAVE_TYPE_CODE in ('CL')
    AND D.LEAVE_TYPE_CODE IS NOT NULL
    group by EMPLOYEE_CODE, EMPLOYEE_NAME, DEPARTMENT_CODE, DEPARTMENT_DESC, CREATED_DATE
    else
    v_return_msg:='Field should not be empty';
    end if;
    END;
    my code actual output
    EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE
    100001....................John............02-OCT-12.................6
    100001....................chris...........01-OCT-12.................4
    how to add column dynamically based on from_date to to_date?
    Thanks and Regards,
    Chris Jerome.

    You cannot add columns dynamically. But you can define a maximum number of numbers and then hide unused columns in your form useing SET_ITEM_PROPERTY(..,VISIBLE, PROPERTY_FALSE);

  • How to add gaussian white noise to array of one's and negative one's ?

    how to add gaussian white noise to array of one's and negative one's ?
    Solved!
    Go to Solution.

    Is it this that your are trying to accomplish:
    TO:
    Here's the code to do that.
    Michel

  • How to add columns in field-symbol

    Dear All,
                  Have made a report for HR - ZHR_CTC by using logical database and field-symbol. Report is working fine, but now have to add columns e.g business area text, positions text etc.
    Have added columns in field-symbol.But not able to fetch data into that.
    Data has to be fetched from different trasparent table comparing <field-symbol>-field.
    Plz suggest the proper way to do it.
    <<text removed>>
    Regards,
    Gulrez Alam
    Edited by: Gulrez Alam on Dec 16, 2008 11:02 AM
    Edited by: Matt on Dec 16, 2008 11:36 AM

    Hi Rimpa,
                   Thanks a lot for you reply, have tried ur suggestion but it's not working. I am not able to understand how to insert data into field-symbol. Plz give some more clarifications about the same.
    Regards,
    Gulrez Alam

  • How to add columns (fields) to header section of an alert e-mail?

    Hi all,
    In a standard out of the box alert template, I want to add custom fields (e.g. Notes, Value p.a.) to the body of an alert e-mail, see photo:
    These cannot be any list/library built-in columns like 'Created', 'Created By' etc.
    The class responsible for those column in 'Alerttemplate.xml' is:
    <![CDATA[ </tr> </table> </td></tr></table> </td> </tr> <tr> <td class="vh" colspan="2">$Resources:Alerts_event_title;</td> <td class="vh">$Resources:Alerts_event_modified;</td> <td class="vh">$Resources:Alerts_event_modifiedby;</td> <td class="vh">&nbsp;</td> </tr> <tr> <td colspan="5" class="rulerow">&nbsp;</td> </tr> ]]>
    How can I add additional fields to that?

    Since there was no input from anyone on the forum, I have come up with a following workaround:
    I could not add any more columns to the alert e-mail body for edited items so I used a 'Title' column to combine all the columns a wanted to display in the e-mail alert.
    These were the 'Prefix' - 'Suffix' 'Product' columns. On 'Edit' and 'New' forms, there is a piece of jquery to combine those 3 columns and store the value in a 'Title' column which is appropriately hidden from the views and forms. There is no 'Quick Edit'
    switched on in the list so jquery will always run setting a 'Title' column correctly.
    Users can see the relevant information right in their inbox so they won't have to log in to SP remotely to look up this information. 

  • How to add column access BADI to appraisal template.

    I am not able to see option to add column access BADI in template at Processing  tab--> Further template behaviour.
    Kinldy let me know how to add it.
    I am able to see only following options
    BC         Business Check
    D1         Default Appraiser
    D2         Default Appraisee
    DE         Default Execution Period
    DN         Default Appraisal Document Name
    DP         Default Part Appraiser
    DR         Default Review Date
    DV         Default Validity Period
    HA         Header Data Change
    PM         Maximum Number of Part Appraisers
    Thanks in advance.
    Dhananjy

    Hello Ravikiran,
    Based on the Role and Status of the appraisal form, turn the Column On/Off/Hide..
    sample code...
    case s_header_status-ap_status.
              when c_status_in_preparation.
                availability = 'H'.
                column_owner   = space.
              when  c_status_in_planning.
                case s_body_columns-column_id.
                  when 'OBJ0'.
                    availability   = 'X'.
                    column_owner   = 'X'.
                    exit.
                  when 'Z003'.
                    availability   = 'X'.
                    column_owner   = 'X'.
    Hope it helps...
    Regards,
    Jothi.P

  • How to add columns for wad in web apllication designer

    hi,
    can any one tell me how to add new columns for analysis item in wad.
    i found an option of adding new rows but not able to find a option of new columns in analysis item.
    please suggest me.
    i will assign points

    Hi,
    There is no functionlaity to add new columns.
    For adding new combinations to the transaction data, the input ready new rows are used. Why do you need new columns?

  • How to add column in Dynamic VO

    Hello All,
    We are on 11.5.10 and
    i am trying to add a column toProduct - Supplier Items - click Orders page
    when i click about this page it is showing this
    POS_SUPPLIER_INQUIRIES177_POS_PO_LINES_D2177_177POS_PO_LINES_DDynamicVO
    This has Dynamci VO.
    How do i add column to this view.
    It seems that this view is based on AK Region POS_PO_LINES_D and this region is based on a view POS_PO_LINES_V.
    Please help me in doing this.
    Thanks,
    Mehta.

    Check the page's controller code. That will point you to the base definition of the VO used in the dynamic view.
    --Shiv                                                                                                                                                                                                                                                   

  • How to add column comments to table

    at the time of creating the table, how to add the comments t columns.

    Hi,
    I do not see any way in which you can add comment on column while issuing create table command. You can add comment on the column only after the table is created.
    Regards
    Anurag Tibrewal.

  • How to add column to compressed table

    Hi gurus,
    Can any one help me how to add a column to compressed tables
    Thanks in advance

    The only difference is if added column has default value. In that case:
    SQL> create table tbl(id number,val varchar2(10))
      2  /
    Table created.
    SQL> insert into tbl
      2  select level,lpad('X',10,'X')
      3  from dual
      4  connect by level <= 100000
      5  /
    100000 rows created.
    SQL> select bytes
      2  from user_segments
      3  where segment_name = 'TBL'
      4  /
         BYTES
       3145728
    SQL> alter table tbl move compress
      2  /
    Table altered.
    SQL> select bytes
      2  from user_segments
      3  where segment_name = 'TBL'
      4  /
         BYTES
       2097152
    SQL> alter table tbl add name varchar2(5) default 'NONE'
      2  /
    alter table tbl add name varchar2(5) default 'NONE'
    ERROR at line 1:
    ORA-39726: unsupported add/drop column operation on compressed tables
    SQL> alter table tbl add name varchar2(5)
      2  /
    Table altered.
    SQL> update tbl set name = 'NONE'
      2  /
    100000 rows updated.
    SQL> commit
      2  /
    Commit complete.
    SQL> select bytes
      2  from user_segments
      3  where segment_name = 'TBL'
      4  /
         BYTES
       7340032
    SQL> select compression from user_tables where table_name = 'TBL'
      2  /
    COMPRESS
    ENABLED
    SQL> alter table tbl move compress
      2  /
    Table altered.
    SQL> select bytes
      2  from user_segments
      3  where segment_name = 'TBL'
      4  /
         BYTES
       2097152
    SQL> SY.

  • How to add columns in a column of datable in JSF

    Hi,
    i am developing a application where i have table (h:dataTale) with columns like Name, department etc. Now i want to divide the Name column of this table into two parts- FirstName and LastName. How can we do this in JSF?
    I tried it by adding seperate datatable (and two columns Firstname and Lastname tothis table) for Name column, it is then displaying the correct firstname and lastname but above that it is adding FirstName and LastName header for every row. How to avoid this? Or is there any way to do this?

    Here is the code snippet:
                             <h:dataTable id="empInfo" border="1" cellspacing="2" cellpadding="5" var="loginBean" value="#{loginBean.arrayListLoginInfo}" >
                                  <h:column>
                                       <f:facet name="header">
                                               <h:outputText  value="Name"/>
                                       </f:facet>
                                       <h:dataTable id="empNameInfo" border="1" cellspacing="2" cellpadding="5" var="loginBean2" value="#{loginBean}">
                                            <h:column>
                                                 <f:facet name="header">
                                                     <h:outputText  value="First Name"/>
                                                </f:facet>
                                                 <h:outputText value="#{loginBean.firstName}"/>
                                            </h:column>                                   
                                            <h:column>
                                                 <f:facet name="header">
                                                     <h:outputText  value="Last Name"/>
                                                </f:facet>
                                                 <h:outputText value="#{loginBean.lastName}"/>
                                            </h:column>                                   
                                       </h:dataTable>                                                                                 
                                  </h:column>                                   
                                  <h:column>
                                       <f:facet name="header">
                                           <h:outputText  value="Department"/>
                                      </f:facet>
                                       <h:outputText value="#{loginBean.department}"/>
                                 </h:column>
                                 <h:column>
                                       <f:facet name="header">
                                           <h:outputText  value="skills"/>
                                      </f:facet>
                                       <h:outputText value="#{loginBean.skills}"/>
                                 </h:column>
                        </h:dataTable> Where loginBean is my managed bean and in that arrayListLoginInfo is the ArrayList which holds loginBeanInfo (this has firstName, lastName, department, skill etc properties) objects.

  • How to Add column with default value in compress table.

    Hi ,
    while trying to add column to compressed table with default value i am getting error.
    Even i tried no compress command on table still its giivg error that add/drop not allowed on compressed table.
    Can anyone help me in this .
    Thanks.

    Aman wrote:
    while trying to add column to compressed table with default value i am getting error.This is clearly explain in the Oracle doc :
    "+You cannot add a column with a default value to a compressed table or to a partitioned table containing any compressed partition, unless you first disable compression for the table or partition+"
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#sthref5163
    Nicolas.

  • How to add column to report from the same table? Gives error now

    Steps to reproduce:
    Build a report on a table with easy report, select all columns
    Add column to the table
    Edit report and add column (one has to click Show Related Tables Only: No to view the same table!)
    Report will give error as it will be build as
    SELECT ... FROM table1, table1

    AH HAAA!!!!
    And I was afraid to convert from the "SQL (Structured Query)" to "SQL". Probably because I blew up my other reports...
    Thanks!

  • How to Call report from Adobe Flex App.

    Hello. We are trying to create a reporting solution for our Adobe Flex Applications. We use java and postgre. We also have Crystal Reports 2008 and run a lot of reports locally on end users machines. We have some reports we would like to call from flex and have execute in java and send a PDF back to the end user. So:
    1. Is it possible to do this with Crystal for Eclipse?
    2. If yes can we send values from flex to the filter fields in the report?
    3. Do we then connect the report diereclty to postrgre to get the data?
    RIght now I have a report running in eclipse connecting to postgre. Just trying to see if we are going down the right path. THanks.

    You can integrate your reports with operational workflows by embedding Adobe Flex
    (SWF) applications into your reports. Using Adobe Flex Builder, you can
    create any business-user UI that accesses report data and also integrates
    with external web services. Data in your report can be passed to the Flex
    application via Flashvars, making it easy to create flexible UI even when you
    don't have web-services access to your data. The Flex applications can do
    tasks like database write-back and can invoke operational workflows directly
    within Crystal Reports.
    Thanks,
    Tej

  • How to add columns dynamically in a classical rep deending on a parameter

    hi all,
    i have a scenario where ii have to add columns in my report depending on a certain parameter.the report should dymnamically add the columns based on the parameter.

    Hello Diego
    Revert your logic and remove or do not display columns if the corresponding parameter is missing or does not have the expected value(s).
    Using ALV lists you would accomplish this using the following coding:
    IF ( <parameter is missing or has not expected value> ).
      ls_fcat-tech = 'X'.
      MODIFY gt_fcat FROM ls_fcat
        TRANSPORTING tech
        WHERE ( fieldname = <column> ).
    ENDIF.
    The column for which this attribute is set in the fieldcatalog will appear neither in the ALV list nor in the layout.
    Now for a classical report (WRITE report ?!) you should develop a similar logic. You have to encapsulate the displaying or writing for each column and make this dependent from the parameter, e.g.:
    LOOP AT gt_data INTO ls_data.
    IF ( <parameter is missing or has not expected value> ).
    " do nothing -> skip this column
    ELSE.
      PERFORM write_column USING ...
    ENDIF.
    ENDLOOP.
    Regards
      Uwe

Maybe you are looking for