Add the columns dynamically publish

I can't pass the data to the new columns that are created in the datagrid.

Even if I refresh the dataprivoider properties.

I can't really judge that the problem is that data cannot move to columns

or columns point to the current data, which I use red lined.

<? XML version = "1.0" encoding = "utf-8"? >
"" < mx:Application xmlns:mx = "http://www.adobe.com/2006/mxml"
layout = "absolute".
minWidth = "955".
minHeight = "600" >
< mx:Script >
<! [CDATA]
Import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
Import mx.controls.advancedDataGridClasses.AdvancedDataGridColumnGroup;

[Bindable]
public static var xmlData:XML = < data >
< rank Actual1 = "44985" Estimate1 = "45000" reelles2 = "44985" Estimate2 = "45000" Actual3 = "44985" estimate3 = "45000" / >
< / data >;

protected function button1_clickHandler(event:MouseEvent):void
{

var adgcg:AdvancedDataGridColumnGroup = new AdvancedDataGridColumnGroup ("Employee");
var adgc:AdvancedDataGridColumn;
var arr:Array = new Array();

for each (var j: * in emp [0]. *)
{

trace ("name of node of each child \n" + j.name ());

adgc = new AdvancedDataGridColumn (j.name ());
adgc.dataField = j.name ();
adgcg. Children.push (adgc);     does not work
arr.push (adgc); doesn't work too ~
}

adgcg. Children = arr;
dg.groupedColumns = [adgcg];
dg.dataProvider.refresh ();
}
[]] >
< / mx:Script >

< mx:XMLList id = "emp" >
< employee >
< name > Christina Coenraets < / name >
555-219-2270 < phone > < / phone >
< Email > [email protected] < / email >
true < current > < / current >
images/arrow_icon_sm.png < image > < / image >
< / employee >
< employee >
< name > Joanne Wall < / name >
555-219-2012 < phone > < / phone >
< Email > [email protected] < / email >
true < current > < / current >
< / employee >
< employee >
< name > Maurice Smith < / name >
555-219-2012 < phone > < / phone >
< Email > [email protected] < / email >
< active > false < / current >
< / employee >
< employee >
< name > Mary Jones < / name >
555-219-2000 < phone > < / phone >
< Email > [email protected] < / email >
true < current > < / current >
< / employee >
< employee >
< name > Benoit Hoyee < / name >
525-220-2228 < phone > < / phone >
< Email > [email protected] < / email >
< active > false < / current >
< / employee >
< employee >
< name > Jack Jones < / name >
125-219-2000 < phone > < / phone >
< Email > [email protected] < / email >
true < current > < / current >
< / employee >
< employee >
< name > Luonce Jos < / name >
< Phone > 555 - 219 - 872 < / phone >
< Email > [email protected] < / email >
true < current > < / current >
< / employee >
< / mx:XMLList >

< mx:VBox autoLayout = 'true '.
width = "1200".
height = "700" >
< mx:AdvancedDataGrid id = "dg".
dataProvider = "{emp}.
Width = "800".
Height = "400" >
< mx:groupedColumns >
< mx:AdvancedDataGridColumnGroup headerText = "Employee" >
< mx:AdvancedDataGridColumn headerText = "Name".
dataField = "name" / >
< / mx:AdvancedDataGridColumnGroup >
< / mx:groupedColumns >
< / mx:AdvancedDataGrid >
< mx:Button click = "button1_clickHandler (event)" "
label = "CreateGroup" / >
< / mx:VBox >

< / mx:Application >

Hello

Here is the solution:

http://FlexMonkey.blogspot.com/2008/05/dynamic-grouping-on-Flex.html

Johnny

Tags: Flex

Similar Questions

  • Can I add the column to the playlist to my music list in itunes?

    I consult my entire list of music, and I'd like to know what category of playlist I created that the song is in. Can I add the column to the playlist to my music list?

    I use an older iTunes. You cannot create a column for playlists, but you can right click on individual tracks and is one of the elements to display the items in the lists of reading in which it is contained.

  • How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?

    I have the 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 lines to my datagrid table how do such thing?

    How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?

    (You can place this code in a Flash or AIR application - it compiles without error, but will not add any columns =)

    Change this:

    public void SetDP (): void
    {
    DGG.dataProvider = MyAC
    MyAC.addItem ({scheduledDate: "05/04/2007", homeTeam: "long hitters Valley", umpire: "Amanda Hugenkis"});
    }
               
    public void AddCol (): void
    {
    var dgc:DataGridColumn = new DataGridColumn ("Umpire");
    var ca:Array = DGG.columns;
    CA.push (DGC);
    DGG.columns = ca;
    }

    Dany

  • get the names of the columns dynamically

    Hi gurus,
    I have the list item filled with lots of names of a table schema.
    I did grid in oracle 10g and I want to fill in the grid with the data that should come at least four/more columns.
    I want to get the trigger list change when whenever any name a table is selected/changed.

    How can I get the names of the columns dynamically
    Please give me the step by step process
    for the filling of the grid...

    Hello

    If you want to get the details of the column, and then use the USER_TAB_COLUMNSview.

    SELECT COLUMN_NAME, DATA_TYPE FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 
    

    Kind regards

    Manu.

  • Classic report - add the column "select box"?

    I have a classic report and you want to add a column with a check box so that the user can select several lines and perform an action on all of the lines (delete selected, for example).  Looks like it should be easy and maybe integrated features, but I don't find it.  Is there a standard way to do this?

    Steve

    APEX 5.0

    Hello

    to add a box to your classic report using apex_item.checkbox like this API function:

    select
        APEX_ITEM.CHECKBOX(p_idx=>1, p_value=>DEPTNO)  as select_dept,
        DEPTNO as DEPTNO,
        DNAME as DNAME,
        LOC as LOC
    from DEPT
    

    You can access the values checked (for example in a process page)

    declare
    v_deleted_depts number := 0;
    begin
    FOR i in 1..APEX_APPLICATION.G_F01.count
    LOOP
      v_deleted_depts := v_deleted_depts + 1;
      delete from dept where deptno = APEX_APPLICATION.G_F01(i);
    END LOOP;
    :P1_DEPTCOUNT := v_deleted_depts;
    end;
    

    P1_DEPTCOUNT (hidden) is just for later interaction with this procedure - for example, you want to present your users with a message of success and error custom as "Deleted & P1_DEPTCOUNT. departments. »

    Maybe you would like to add an option to check all checkboxes at once. If so, read this blogpost Blog of Carl Backstrom: September 2007.

    Kind regards

    Pavel

    Edit: don't forget to toggle the leak key for special characters not your column "checkbox.

  • Add the column in the collection

    Hi gurus

    I created 1 collection as below:

    Create the Collection with the type of table emp

    type c_emp is the table emp % rowtype;

    v_emp:=c_emp() c_emp;

    Now I want to add more than 2 columns in this collection, first name of the column is varchar2 (10) and and 2nd name column is varchar2 (10) s but unable to understand how will I achieve this?. Please guide. Thank you

    Concerning

    Shu

    I created 1 collection as below:

    Create the Collection with the type of table emp

    type c_emp is the table emp % rowtype;

    v_emp:=c_emp() c_emp;

    Now I want to add more than 2 columns in this collection, first name of the column is varchar2 (10) and and 2nd name column is varchar2 (10) s but unable to understand how will I achieve this?.

    You cannot change this collection. You must create a new. And you use no reserved words (for example, the "group") for the names.

    DECLARE

    CURSOR c1 IS (SELECT e.*, cast (null as varchar2 (10) GroupName, cast (null as name varchar2 (10))))

    FROM emp e);

    TYPE typ_tbl IS TABLE c1% rowtype;

    v typ_tbl;

    BEGIN

    . . .

  • How to add the column to the compressed table

    Hi gurus,

    Can someone help me how to add a column to compressed tables


    Thanks in advance

    The only difference is if added column has a default value. In this 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.

  • Try to add the column to Oracle DB

    I'm no expert with Oracle, so excuse my ignorance. However, I am trying to use CF to add a column to a table in Oracle 10 g DB. The code I use is:

    < cfquery name = "addCol" datasource = "SOWGEN" >
    ALTER TABLE 'TBL_PASSWORDS '.
    Add a column 'approved' char (1) DEFAULT ' don't
    < / cfquery >


    I received this an error of:

    [Macromedia] [Oracle JDBC Driver] [Oracle] ORA-00903: invalid table name

    Certainly I double checked spelling and the existence of this table, but I can assue you, it exists. What I am doing wrong? Again, sorry for the newb question. Thanks in advance for the help.

    Nevermind, just after that I posted this question, I solved it mine by using the syntax in this way:


    ALTER TABLE TBL_PASSWORDS
    ADD (approved char (1) default 'n')

    Maybe this will help someone else.

  • Sort the columns dynamically built DataGrid...

    Hi people...
    usually, I'm building my DataGrid dynamically... with something like this:

    ... omissis...
    SQLstatement.text = "SELECT name, address FROM myDBTable";
    SQLstatement.execute ();
    resultSQL = SQLstatement.getResult ();
    MyArrayCollection.source = resultSQL.data;
    myDataGrid.dataProvider = MyArrayCollection;
    ... omissis...

    and it works perfectly... the problem is that resultSQL.data, by default, is a table sorted by "abc" (ehmmm... in English is alphabetical sorting?).
    Could, I want the same sort of my query, where the NAME came before the ADDRESS...

    Is there a solution?
    I don't want to pre-build a datagrid with all columns... because it cancels my dynamic datagrid features...

    Thanks for all help...
    bye bye ^ _ ^.

    Thanks for your advice ntsiii :))

    but now I use a SQLite database... so I prefer using Flex function...
    but I tried a solution (Pentecost of google of course help)

    the idea is the following:
    Once completed this datagrid, I copy dg.colums to a temporaney tempArray...
    can I swap the columns that are not in the right place... and in the end, I put dg.columns = tempArray...

    I tried this method time ago... but it did not work because I tried to change directly from db.columns [x]...

    Now, I'm convinced!

    Bye bye

  • How to add the column to the table of QSqlDatabase if does not exist

    Hello

    I have an app World and want to update to include more features.

    To do this I need to add more columns in an existing database table created using QSqlDatabase, someone knows how to do this please?

    Tim

    Hi, you can use ALTER TABLE

    http://www.w3schools.com/SQL/sql_alter.asp

  • Add the column to an existing table-based user-defined type

    Hello guys,.
    I am compiling my function that returns a type defined by the user based on an existing table. Throughout the process of initialization so my query returns an additional column - SCORE (1). Here is my package:

    create or replace
    PACKAGE STAFF_AGENCY_PKG AS

    TYPE TYPE_SEEKER_TABLE IS TABLE OF THE DRAW. SEEKER % ROWTYPE;
    FUNCTION GET_SEEKERS (IN_KEYWORD IN VARCHAR2)
    TYPE_SEEKER_TABLE RETURN PIPELINE;

    END STAFF_AGENCY_PKG;
    -------

    create or replace
    STAFF_AGENCY_PKG PACKAGE BODY
    AS

    FUNCTION GET_SEEKERS (IN_KEYWORD IN VARCHAR2)
    TYPE_SEEKER_TABLE RETURN PIPELINE
    IS
    R_TBL TYPE_SEEKER_TABLE; -to return
    BEGIN
    FOR R IN)
    SELECT Seeker.SEEKER_ID,
    Seeker.FIRSTNAME,
    Seeker.LASTNAME,
    Seeker.NATIONALITY,
    Seeker.ISELIGIBLE,
    Seeker.BIRTHDATE,
    Seeker.ISRECIEVEEMAILS,
    Seeker.HIGHESTDEGREE,
    Seeker.ETHNICITY,
    Seeker.GENDER,
    Seeker.ISDISABILITY,
    Seeker.DISABILITY,
    Seeker.CV,
    Seeker.PASSWORD,
    Seeker.PREFFERED_CITY,
    SEEKER. E-mail
    SEEKER. JOB_PREFERENCES_ID,
    SCORE (1)
    THE APPLICANT Seeker
    WHERE CONTAINS (CV, ' < query >)
    < textquery lang 'grammar' = 'context' = > ' |
    GET_RELATED_CATEGORIES (IN_KEYWORD) |
    ' < / textquery >
    < score datatype = "INTEGER" / >
    (< / query > ', 1) > 0
    )
    LOOP
    PIPE ROW (R); -Error (38,10): PLS-00382: expression is of the wrong type
    END LOOP;
    RETURN;

    END GET_SEEKERS;
    END STAFF_AGENCY_PKG;

    How do I change my user type to be sufficient?

    Oracle version 11.2.0.1.0
    Thanks in advance!

    >
    How do I change my user type to be sufficient?
    >
    You will need to create two new TYPEs. The one who has all the columns of the draw. The REQUESTOR table and the new column SCORE, then a TYPE which is an array of the first type.

    See example 12-22 using a Pipelined Table function for a Transformation in the PL/SQl language reference

    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/tuning.htm#i53120

    Here's the first part

    -- Define the ref cursor types and function
    CREATE OR REPLACE PACKAGE refcur_pkg IS
      TYPE refcur_t IS REF CURSOR RETURN employees%ROWTYPE;
      TYPE outrec_typ IS RECORD (
        var_num    NUMBER(6),
        var_char1  VARCHAR2(30),
        var_char2  VARCHAR2(30));
      TYPE outrecset IS TABLE OF outrec_typ;
     FUNCTION f_trans(p refcur_t)
          RETURN outrecset PIPELINED;
    END refcur_pkg;
    /
    
    CREATE OR REPLACE PACKAGE BODY refcur_pkg IS
      FUNCTION f_trans(p refcur_t)
       RETURN outrecset PIPELINED IS
        out_rec outrec_typ;
        in_rec  p%ROWTYPE;
      BEGIN
    

    Change

      TYPE outrec_typ IS RECORD (
        var_num    NUMBER(6),
        var_char1  VARCHAR2(30),
        var_char2  VARCHAR2(30));
      TYPE outrecset IS TABLE OF outrec_typ;
    

    to include all the columns you need. Unfortunately, you have to manually list all the columns in the draw. The REQUESTOR table. If you think you need this same structure in other places you must create them as SQL types instead of PL/SQL types.

    This example should be enough to show you how to modify your code to do something similar.

  • Merge with VB Script ascii_diadem_9.1_or_later.zip .csv files: how to add the column/channel with filename

    Hello

    I use ascii_diadem_9.1_or_later.zip to merge the data from several .csv files.

    The problem is that I am so some weird futuristic timestamps in a channel

    which do not appear in the original .csv files:

    How to adjust the VB Script automatically adds a new channel to the a .csv resulting

    file with the original name of the .csv file for debugging purposes?

    Any help is greatly appreciated!

    Thanks, Katharina

    Hi Katharina,

    What happens when you drag your tiara BROWSER or Windows Explorer data files in the data portal?  See all date/time values in a table in VIEW of this channel?  The problem may be that you do not have a use but which properly load your data files.  The example is designed to show you how to concatenate several files of data together, but assumes that you could provide / have your own use.  If you use work already, then look for these lines to the top of the VBScript and substituting the name of your use "CSV".  If your files have a file extension different "*.csv", then you must also change the line "FileExt '.

    FileExt  = ' CSV files, *.» CSV »  ' « *. DAT; *. CSV '.
    Use = "CSV" ' "' or 'SpecificDataPluginName '.

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • 3.0 generated statement adds the column

    Hello

    usually, we have our data model changed in the Oracle Designer and the database is then passed under the generated script.

    Currently a developer asked me to make a quick change to a table, so it could test a code. That's why I used SQL Developer. The dialog box is simple, but I was expecting to see the generated code in the SQL tab I see in other tools. What follows is not very useful if you want to copy the code to run it again in the other plans ;-)
    var sql;
    if (prompt1 == 'NUMBER' && prompt1.length>0 && prompt3.length>0 ) {
      sql = 'alter table "' + OBJECT_OWNER + '"."' + OBJECT_NAME +'" add('+prompt0 + ' ' + prompt1 + '(' + prompt2 + ','+ prompt3 + '))';
    } else if ( ( prompt1 == 'NUMBER' && prompt1.length>0 && prompt3.length==0) ||  prompt1 == 'VARCHAR2' ) {
      sql = 'alter table "'+OBJECT_OWNER+'"."'+OBJECT_NAME+'" add('+prompt0+' '+prompt1+'('+prompt2+'))';
    } else {
      sql = 'alter table "'+OBJECT_OWNER+'"."'+OBJECT_NAME+'" add('+prompt0+' '+prompt1+')';
    }
    dbutil.execute(sql);
    Concerning
    Marcus

    Yes, using the built-in script. I need to change that to show the final sql script in use vs.

    -kris

  • How to add the new column to a specific position

    Hello

    My table looks like Fallows.

    Select * from company

    PRODUCT_ID COMPANY_ID COMPANY_SHORT_NAME COMPANY_LONG_NAME
    11001An Inc.Long name A Inc.
    11002B Inc.Long name B Inc.
    11003C Inc.Long name C Inc.
    21004D Inc.Long name D Inc.
    21005E Inc.Long name E Inc.
    21006F Inc.Long name F Inc.

    My requirement is I would LIKE to add A NEW COLUMN AS COMPANY_LOCATION NEXT TO COMPANY_SHORT_NAME

    How to get there.


    I tried like Fallows alter company table add company_location varchar2 (100) after company_short_name;

    but this query shows the error

    ORA-01735: invalid option of ALTER TABLE

    If the query I've tried is correct?

    Give me your suggestions.

    Thanks in advance.

    As long as you're on 11 GR 2 or lower, it will not work.

    There is no Clause "AFTER"in the alter table do not add column."

    You have the chance to use dbms_redefinition (when no interruption of service is possible) or manually create a new table with the columns in the order you need and then migrate the data and then drop the original and rename a new.

    In case you are already on 12 c, you have a chance to add the column to the end and then make visible columns and invisible status in the right order. This way your column will get to the position that you want it to be.

    Kind regards

    Carsten

  • How to add the new column in existing table to our desired location?

    How to add the new column in existing table to our desired location?

    For example, I have to add the new column 'course' before the salary column in the emp table.

    I think the best way is to add the column at the end of the table and create a new view with the order of the columns...

    Another option...

    places the data into a temporary table and recreate the table with the correct order of the columns, and then insert data to the table from the temporary table

    Refer

    Add column (from table) in the desired position

    Example:

    CREATE TABLE temp_my_user LIKE)

    SELECT * FROM password);

    DROP TABLE password;

    (Password) CREATE TABLE

    userID NUMBER

    , first name VARCAHR2 (25)

    , middleInitial VARCHAR2 (1)

    (, name VARCHAR2 (25));

    INSERT INTO password (userID, firstName, lastName)

    (SELECT username

    first name

    lastName

    OF temp_my_user);

    DROP TABLE temp_user;

Maybe you are looking for