remove the line in dataGrid + button

Hello

I try to add a button in a DataGrid and give it a value from the dataProvider in Flex

For example, I have a dataGrid that displays my data and I added a button 'delete' that, once selected needs to get the ID of the selected line in order to remove the line of correct dataGrid / selected etc...

I've included the button in the DataGrid as a component which is fine, but I'm unable to assign the key a value etc.

< mx:DataGrid id = "testDG" dataProvider = "..." ">

< mx:columns >
< mx:DataGridColumn dataField = "a" headerText = "B" / >
< mx:DataGridColumn dataField = "b" headerText = "B" / >
< mx:DataGridColumn dataField = "c" headerText = "C" / >

< mx:DataGridColumn id = "deleteButtonCol" >
< mx:itemRenderer >
< mx:Component >
< mx:Button label = click on 'Remove' = "must call a function here and pass the row ID" / >
< / mx:Component >
< / mx:itemRenderer >
< / mx:DataGridColumn >

< / mx:DataGrid >

It is in a component object I think he cannot communicate with scripts outside this component...? It has something to do with 'flex coupling components' allowing them to communicate.

Can someone give me one advises on how to on this subject?

Thank you
Jon.

Yes, the code inside an element is in its own local scope. If you need get within reach of the DataGrid (at a higher level), use the property of the component "outerDocument". Some info here:

http://livedocs.Macromedia.com/Flex/2/langref/MXML/component.html

Tags: Flex

Similar Questions

  • Remove the line with alert button

    Hello

    I have a table which can add and delete rows dynamically. An alert must be added to the button delete what I've done.  The works warning, but when you select OK on the alert line is not deleted.

    It would be the right way to accomplish this?

    I'm not a programmer and now wondering if my edit code is wrong or there is an alternative solution.

    Thank you

    Capture.PNG

    This is the code I have for the button Delete.

    Form1. FSE_1.Pre_EX. Buttons. Remove::click - (JavaScript, both)

    CMSG var = "continues with the action underway will remove all entries in cell in this row.

    CMSG += ' \n\nDo you want to continue?

    var nRtn = app.alert (GSMC, 1, 1, 'Question Alert Box');

    if(nRtn == 4)

    {If (Table1._Item.count > 1)

    Table1._item.removeInstance (Table1._Item.count - 1);

    Console.println ("the answer is Yes");

    }

    Another yew (nRtn is 3)

    {/ / No answer}

    Console.println ("the answer is no");

    }

    on the other

    {//Unknown response

    Console.println ("the response was something other than yes/no:"+ nRtn ");

    }

    ------------------------------------------------------------------------------------------ ----------------------------------

    This is the code I have for the button Delete before adding the alert that worked.

    Form1. FSE_1.Day_1.buttons.Remove::click - (JavaScript, both)

    If (Table1._Item.count > 1)

    Table1._item.removeInstance (Table1._Item.count - 1);

    The way I understand how it works at the moment, is that you remove the last line of the table... If you want to delete the line where is the button Delete, you should be removing the instance itself with its index...

    rather than use the following line

    Table1._item.removeInstance (Table1._Item.count - 1);

    You should have something like this

    'this' being button and tell me that you have a subform to remove and add the button

    Table1._item.removeInstance (this.parent.parent.index); the first parent is the subform and the second parent is the line

    I hope this helps!

  • How to remove the new but useless, "buttons links" at the bottom of the default FF start pg?

    By default new FF w/Google is great and thank you too much. Prefer to remove the new button at the bottom of the page links and have more empty space on the page where the new links are currently. The links are already very well for use at the top of the pg in a toolbar. Remove the 6 new possible button links? Thank you.

    Add code to the file in the chrome folder userContent.css.

    Customization files (interface) userChrome.css and userContent.css (Web sites) are located in the chrome folder in the user profile folder.

    You can use this button to go to the Firefox profile folder:

    • Help > troubleshooting information > profile directory: opens showing the file
    @-moz-document url(about:home){#launcher{display:none!important}}
  • remove the line spacing of a string

    In the attached VI, I expected my output to a long chain, but instead, it's a chain with what looks like inserted line breaks. This is my output looks like:

    xx xx xx xx xx xx xx xx

    xx xx xx xx xx xx xx xx

    xx xx xx xx xx xx xx xx

    and what I want is:

    xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx

    Is there an easy way to remove the line breaks?

    Thank you

    Just do a "find and replace String" with LF as search string, empty string (or probably a space if necessary) as string to replace and replace all instances set to true.

    Hope this helps

  • How remove the line by line by comparing to the first column?

    Hello!

    I have a problem - I need to remove the line by line, but the problem is, I know that the first COLUMN of the table is a PK.
    To retrieve the NAME of the COLUMN that I use:

    SELECT column_name, table_name FROM USER_TAB_COLUMNS WHERE column_id = 1 and table_name = c1.tmp_table_name;
    But it does not somehow.
    Below you can see my script (which has not worked for now):

    declare
    XXX varchar2 (100);
    Start
    C1 in (select table_name, tmp_tables tmp_table_name) loop
    IMMEDIATE EXECUTION
    ' SELECT column_name in ' | xxx | "USER_TAB_COLUMNS WHERE column_id = 1 AND table_name = ' |" ' || C1.tmp_table_name | " ' ;
    immediate execution
    "start."
    for c2 in (select * from ' | c1.tmp_table_name | start loop ')
    Insert into ' | C1.table_name | "values c2; delete from ' | C1.tmp_table_name | 'where ' | xxx |' = c2.' | xxx |'; exception: when other then null; end; end loop; end;';
    end loop;
    end;

    P.S. The Inserts work perfect. I have a problem with deleting lines that are in c1.table_name, of c1.tmp_table_name (the two tables have the same structure, PK, always), because I have the names of columns different another tables which are PK. (for example: K, ID, NS and so on) Please help me to write the correct script.
    For example this will be for the first line recovered as:
    Start
    C1 in (select table_name, tmp_tables tmp_table_name) loop
    immediate execution
    «Start for c2 in (select * from ' |)» C1.tmp_table_name | Start loop ')
    Insert into ' | C1.table_name | "values c2; delete from ' | C1.tmp_table_name: ' where K = c2. K; exception: when other then null; end; end loop; end;';
    end loop;
    end;
    This script works perfectly. But I have many other tables with different PK - K No.

    Solution with the logging of errors table

    -- create the error-logging table
    CREATE TABLE tbl_MergeErrors (
        Stamp       TIMESTAMP(3),
        TableName   VARCHAR2(30),
        KeyColumn   VARCHAR2(30),
        KeyValue    VARCHAR2(4000),
        ErrorCode   NUMBER(5),
        ErrorMsg    VARCHAR2(4000),
    
      CONSTRAINT pk_MergeErrors
          PRIMARY KEY (TableName, Stamp)
          USING INDEX
    )
    /
    
    -- procedure to insert errors
    CREATE OR REPLACE
    PROCEDURE LogMergeError (pTableName  IN VARCHAR2,
                             pKeyColumn  IN VARCHAR2,
                             pKeyValue   IN VARCHAR2)
    IS PRAGMA AUTONOMOUS_TRANSACTION;
    
        -- you couldn't insert SQLCODE or SQLERRM directly into a table (ORA-00984)
        nSQLCODE   NUMBER(5)      := SQLCODE;
        vcSQLERRM  VARCHAR2(4000) := SQLERRM;
    
    BEGIN
      INSERT INTO tbl_MergeErrors
             (Stamp, TableName, KeyColumn, KeyValue, ErrorCode, ErrorMsg)
          VALUES (SYSTIMESTAMP, RTrim( SubStr( pTableName, 1, 30)),
                  RTrim( SubStr( pKeyColumn, 1, 30)), SubStr( pKeyValue, 1, 4000),
                  nSQLCODE, vcSQLERRM);
      COMMIT WORK;
    
    -- if an error occured here, then just roll back the autonomous transaction
    EXCEPTION
      WHEN OTHERS THEN   ROLLBACK WORK;
    END LogMergeError;
    /
    
    -- create the tables and insert test-data
    CREATE TABLE TMP_TABLES (
        TABLE_NAME       VARCHAR2(200),
        TMP_TABLE_NAME   VARCHAR2(200),
      CONSTRAINT TMP_TABLES_X PRIMARY KEY (TABLE_NAME)
    )
    /
    CREATE TABLE TMP_KL002 (
        K   VARCHAR2(40),
        N   VARCHAR2(200)
    )
    /
    CREATE TABLE TMP_TABLE1 (
        NS   VARCHAR2(40),
        N    VARCHAR2(200)
    )
    /
    CREATE TABLE KL002 (
        K VARCHAR2(40),
        N VARCHAR2(200),
      CONSTRAINT PK_KL002 PRIMARY KEY (K)
    )
    /
    CREATE TABLE TABLE1 (
        NS   VARCHAR2(40),
        N    VARCHAR2(200),
      CONSTRAINT PK_TABLE1 PRIMARY KEY (NS)
    )
    / 
    
    INSERT INTO TMP_TABLES (TABLE_NAME, TMP_TABLE_NAME) VALUES ('kl002','tmp_kl002');
    INSERT INTO TMP_TABLES (TABLE_NAME, TMP_TABLE_NAME) VALUES ('table1','tmp_table1');
    INSERT INTO tmp_KL002 (K, N) VALUES ('00', 'none');
    INSERT INTO tmp_KL002 (K, N) VALUES ('07', 'exists');
    INSERT INTO tmp_KL002 (K, N) VALUES ('08', 'not assigned');
    INSERT INTO tmp_table1 (NS, N) VALUES ('2000', 'basic');
    INSERT INTO tmp_table1 (NS, N) VALUES ('3000', 'advanced');
    INSERT INTO tmp_table1 (NS, N) VALUES ('4000', 'custom');
    COMMIT WORK;
    
    -- to test, if it works correct when primary key values exists before
    INSERT INTO KL002 VALUES ('07', 'exists before');
    COMMIT WORK;
    
    -- check the data before execution
    SELECT * FROM TMP_KL002 ORDER BY K;
    SELECT * FROM KL002 ORDER BY K;
    SELECT * FROM TMP_TABLE1 ORDER BY NS;
    SELECT * FROM TABLE1 ORDER BY NS;
    
    -- empty the error-logging table
    TRUNCATE TABLE tbl_MergeErrors DROP STORAGE; 
    
    -- a solution
    DECLARE
    
        PLSQL_BLOCK  CONSTANT VARCHAR2(256) := '
    BEGIN
      FOR rec IN (SELECT * FROM <0>) LOOP
        BEGIN
          INSERT INTO <1> VALUES rec;
          DELETE FROM <0> t WHERE (t.<2> = rec.<2>);
        EXCEPTION
          WHEN OTHERS THEN
              LogMergeError( ''<1>'', ''<2>'', rec.<2>);
        END;
      END LOOP;
    END;';
    
    BEGIN
      FOR tabcol IN (SELECT t.Tmp_Table_Name, t.Table_Name, c.Column_Name
                     FROM Tmp_Tables t,
                          User_Tab_Columns c
                     WHERE     (c.Table_Name = Upper( t.Tmp_Table_Name))
                           AND (c.Column_ID = 1)
                ) LOOP
        EXECUTE IMMEDIATE Replace( Replace( Replace( PLSQL_BLOCK,
                                   '<0>', tabcol.Tmp_Table_Name),
                                   '<1>', tabcol.Table_Name),
                                   '<2>', tabcol.Column_Name);
      END LOOP;
    END;
    / 
    
    -- check the data after execution ...
    SELECT * FROM TMP_KL002 ORDER BY K;
    SELECT * FROM KL002 ORDER BY K;
    SELECT * FROM TMP_TABLE1 ORDER BY NS;
    SELECT * FROM TABLE1 ORDER BY NS;
    
    -- ... and also the error-logging table
    SELECT * FROM tbl_MergeErrors ORDER BY Stamp, TableName;
    
    -- of couse you must issue an COMMIT (the ROLLBACK is only for testing
    ROLLBACK WORK;
    
    -- drop the test-tables
    DROP TABLE TABLE1 PURGE;
    DROP TABLE KL002 PURGE;
    DROP TABLE TMP_TABLE1 PURGE;
    DROP TABLE TMP_KL002 PURGE;
    DROP TABLE TMP_TABLES PURGE;
    
    -- you shouldn't drop the error-logging table, but I use it to free up my db
    DROP TABLE tbl_MergeErrors PURGE;
    

    Greetings, Niels

  • I need script to remove the line with 2 points, another script to remove next lines

    I need script to remove the line with 2 points, another script to remove next lines of two scripts needed help please

    Thanks in advance

    Concerning

    Lakshmiganth

    Scroll through each pathitem and look at the length of his pathPoints group.  If the length is equal to 2 and then use the remove() method to remove it.  For example (this is rough, off the top of my head):

    var lines = new Array();

    for (i = 0;  I have< app.activedocument.pathitems.length; ="" i++)="">

    If (app.activeDocument.pathItems [i].pathPoints.length == 2) {}

    Lines.push (App.activeDocument.pathItems [i]);

    }

    }

    for (i = 0;  I have< lines.length; ="" i++)="">

    Lines [i]. Remove();

    }

  • Remove the line

    I draw a line from point A to point B (lineMove & lineTo). I am able to delete the line by a button or other way?

    {We (Release)}

    _root.createEmptyMovieClip ("line_mc");

    line_mc.linsStyle(1x0000FF,100);

    line_mc. LineTo (100,75);

    }

  • To remove the line on click of a button

    Hi friends,

    I use JDeveloper 11.1.1.5.0.

    I have a table full of 10 lines. I have a delete button. Click on the button I want to delete the selected line.

    The method works well, but compared to the level of the page it will not be deleted immediately.

    If I refresh the page, then it shows that the line is deleted.

    Please help me.

    Thank you

    $@M$

    Add the following two lines in your code before the return of rt;

    this.getEmployeeDetailsVO1().clearCache() ;
    this.getEmployeeDetailsVO1().executeQuery() ;
    

    as for your code below

    ExternalContext ectx =
    FacesContext.getCurrentInstance().getExternalContext();
    HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
    HttpSession SessionId = (HttpSession)ectx.getSession(true);
    String Id = (String)SessionId.getAttribute("Id");
    

    You can simply use

    String Id = (String)ADFContext.getCurrent().getSessionScope().get("Id");
    

    And the value in use of session

    ADFContext.getCurrent().getSessionScope().put("Id","YOUR_VALUE");
    

    Let me know if it works for you :)

  • A table does not remove the lines

    I created a tabular presentation. I select one or more lines with the line selector. I click the button Delete and you get a warning/confirmation message. I select OK, then refresh the page. I selected the lines are always present.

    I edited the multi-rang button - remove and found that Action of database has been set no Action database, so I changed it to Action SQL DELETE.

    Still not delete.

    What Miss me?

    Hi mdwyer,.

    I edited the multi-rang button - remove and found that Action of database has been set no Action database, so I changed it to Action SQL DELETE.

    No need for the modification of database SQL DELETE action Action, it is correct with no Action from the database.

    I created a tabular presentation. I select one or more lines with the line selector. I click the button Delete and you get a warning/confirmation message. I select OK, then refresh the page. I selected the lines are always present.

    1. check that the request after clicking on delete...

    For example

    JavaScript:apex.confirm (htmldb_delete_message, 'MULTI_ROW_DELETE');

    Here MULTI_ROW_DELETE is passing as request.

    2. change your ApplyMRD process and check the status

    When you press the button: no condition button

    Condition type: request = Expression1

    Expression 1: MULTI_ROW_DELETE

    Check the request that you place the button Delete is same as a condition of the terms of the Expression 1 or not.

    Or better, you can create examples on apex.oracle.com, which helps the user to study and solved the problem.

    If your problem still persists, then try to recreate the form of tables and check.

    Hope this helps you,

    Reg

  • Help - Add line and remove the line does not!

    Not able to understand why the button "Add and Remove row" do not work.

    Thanks in advance

    Hello

    To remove the specified line, use the function

    Table1._Row1.removeInstance (IND);

    where ind is the index of the line.

    You should put the button Delete in each row of the table and write onClic script:

    Table1._Row1.removeInstance (this.parent.index);

    BR,

    Paul Butenko

  • I want to remove the "Change search settings" button in the search bar and cannot find a way to fix it.

    I already removed the new changes of the research with the rocking of the browser.search.showOneOffButtons, but I don't want to search there settings button to be misclicked on. Is there a way to fix this?

    With this, you can skip the search quite bar.

    Context search {web link}
    Develops the context menu item 'Search' in a list of
    installed search engines, allowing you to choose the engine
    you want to use for each search.

  • Remove the line from the Excel report when generating reports

    Hi all

    I try to delete whole lines of the report excel during the generation of the report in excel, but I'm not able to do this. Here I am attaching an excel template, in that I want to delete line no 3 to 5 How can I do this. I'm using LabVIEW 8.6 Report Generation Toolkit for Microsoft Office 1.1.3

    Thanks and greetings...

    If there is no function to generate report for simple operations like this, then use the palette of VBA macros to run this code snippet:

    'remove all lines between two rows inclusive '.
    Void DeleteRows (intTopRow As String, intLastRow As Integer)
    Range (cells (intTopRow, 1), (intLastRow, 1)). EntireRow.Delete xlShiftUp
    End Sub

    Import Excel module allows to load the .bas file then run Excel Macro with parameters 3 and 5.  Check your security settings if you get an error in the macro.

  • Remove the line to the next intersection addon?

    Hi all

    I've noticed with the type of work I do it would be very convenient if there is a tool that, when I click on any line, it will partially remove this line to the point where it intersects with any other line or the guide.

    Does anyone know of a tool or modification of existing tools addon for this?

    Thank you very much

    Try the tool shape illustrators.

    See manual o how to use with lines.

    Or try dynamic Sketch plugin

    DynamicSketch plugin for Adobe Illustrator - clever graphic

  • How to remove the lines of code at the level of the site with different content?

    How can I remove the same lines of code at the level of the site?

    I want to delete all of the code line up to 4000 pages 50 - line 80, but the lines do not contain the same code can not use 'find and replace '.

    Any ideas would be appreciated - thanks.

    SED

    http://www.Panix.com/~ElfLord/UNIX/sed.html

    Can you show us 2 examples of code to remove?

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB

  • Remove the line breaks in the HTML Source Code

    Is it possible to remove all line breaks in the code source HTML generated by Dreamweaver? After using the Dreamweaver design view window, I want to assure you that all the source code of the html page I created is going on a single line. Is there a simple way to remove all line breaks, or tell Dreamweaver to create the HTML code on a line?

    Ki Song says:
    > Is it possible to remove any line break in the HTML source code
    > generated by Dreamweaver? After the use of the design view window in
    > Dreamweaver, I want to assure you that all the source code for the
    > goes from html page I created on a single line. Is there an easy way
    > to remove all breaks online or tell Dreamweaver to create the HTML code
    > code on a line?

    http://www.TJKDesign.com/articles/whitespace.asp

    HTH,
    --
    Thierry
    Articles and tutorials: http://www.TJKDesign.com/go/?0
    Perfect FAQ page: http://www.TJKDesign.com/go/?9
    Templates CSS - P: http://www.TJKDesign.com/go/?1
    CSS tabs menu: http://www.TJKDesign.com/go/?3

Maybe you are looking for

  • application with the message «active zoom» crash

    On several gaming applications like minecraft, stop the app (hang) and display the message "active zoom" Although there was no action zoom on the screen activation. We thought it was a charging problem, but the question adds when one application is l

  • The VRAM/GPU may be improved/changed on my iMac?

    I have an iMac 27 "i5 2.7 Ghz 4 GB ram 1 TB of storage and an AMD Radeon HD 6770 M with 512 MB of VRAM mid 2011. I know that Aries is easily extensible and I intend to upgrade. But I want to upgrade the 512 MB at least 1 GB of VRAM weeny. Is it possi

  • Cannot uninstall/remove Citrix XenApp Plugin Weg

    We cannot delete an incorrect version of Citrix XenApp Weg Plugin downloaded last week.  It says "prepare to remove", then another window comes up saying "Please wait while Windows configures Citrix XenApp Plugin Weg", then a third window appears say

  • C7280 - three new cartridges today - all recognized but DO NOT print!

    Hello Today, I installed three provided HP ink cartridges (black, Magenta and Cyan) and all are recognized as present and full. Whenever I try to print - Similarly, the automatic test report - there are NO black, Magenta or Cyan Ink on the page. I've

  • DV7-6b55dx

    Hello, I have a hp dv7 and am locked out. The reset code is: 52444306 Thank you for helping