How to add the option to search (filter) to my existing code?

Hello

The following code works fine. I want to just add a text box to search for the item in the huge list. Please help me in this regard. I would like to pay in return for any help & support because I am in urgent need of this code (I am from INDIA).

[code]

Import fl.data.DataProvider;
Import fl.controls.dataGridClasses.DataGridColumn;
import flash.events.Event;
import flash.net.URLRequest;
Import fl.events.ListEvent;


var COL_SLNO:DataGridColumn = new DataGridColumn("SL_NO");
myGrid.addColumn (COL_SLNO);
COL_SLNO. Width = 40


var COL_DATE:DataGridColumn = new DataGridColumn("DATE");
myGrid.addColumn (COL_DATE);
COL_DATE.width = 130


var COL_PDFURL:DataGridColumn = new DataGridColumn("FILE_NAME");
myGrid.addColumn (COL_PDFURL);
COL_PDFURL.sortOptions = Array.NUMERIC;
COL_PDFURL. Width = 195


var allDatabase:Array = [] ;// contains all users as in xml
var currentDatabase:Array = [] ;// contains users that should be displayed


var _loader:URLLoader = new URLLoader();
var _data:XML = new XML();


_loader.addEventListener (Event.COMPLETE, readXML);
_loader. Load (new URLRequest("EHSSDocs/Database.xml"));


function readXML(event:Event):void
{
_data = new XML (event.target.data);
for each (var in _data.user usr)
{
allDatabase.push ({id: usr.@id, SLNO: usr.@SLNO, DATE: usr.@DATE, PDFURL: usr.@PDFURL});
}
currentDatabase = allDatabase.concat ();
updateList();
}


function updateList (): void
{
myGrid.dataProvider = new DataProvider ();


for (var i: int = 0; i < currentDatabase.length; i ++)
{
myGrid.addItem ({SL_NO: currentDatabase [i].}) SLNO, DATE: currentDatabase [i]. DATE, file name: currentDatabase [i]. PDFURL});
}


myGrid.addEventListener (Event:ListEvent.ITEM_CLICK, gridItemClick);
myGrid.addEventListener (ListEvent.ITEM_CLICK, gridItemClick);
function gridItemClick (e:ListEvent): void
{
var urlR:URLRequest = new URLRequest (e.target.getItemAt (e.rowIndex). FILE_NAME)
navigateToURL (urlR, "_blank");
}
}

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

I hope that the following code may solve the problem. But do not know how to edit because I am recovering data using the XML file.

[code]

var itemTextInput:TextInput = new TextInput();
itemTextInput.move (10, 10);
itemTextInput.addEventListener (Event.CHANGE, changeHandler);
addChild (itemTextInput);


function changeHandler(event:Event):void {}
var arr:Array = dp.toArray ();
var filteredArr:Array = arr.filter (filterDataProvider);
myGrid.dataProvider = new DataProvider (filteredArr);
}


function filterDataProvider(obj:Object,_idx:int,_arr:Array):Boolean {}
var txt1:String = itemTextInput.text;
var txt2:String = obj.item.substr (0, txt1.length);
If (txt1.toLowerCase () is {txt2.toLowerCase ()})
Returns true;
}
Returns false;
}

Thanks in advance for any help.

to start, you need to import a TextInput component in your library and your code.

Next, you need to define RFP and change of position in the filter function to match one of your column names (IE, the one that you want to filter).

[code]

Import fl.data.DataProvider;
Import fl.controls.dataGridClasses.DataGridColumn;
import flash.events.Event;
import flash.net.URLRequest;
Import fl.events.ListEvent;

var COL_SLNO:DataGridColumn = new DataGridColumn("SL_NO");
myGrid.addColumn (COL_SLNO);
COL_SLNO. Width = 40

var COL_DATE:DataGridColumn = new DataGridColumn("DATE");
myGrid.addColumn (COL_DATE);
COL_DATE.width = 130

var COL_PDFURL:DataGridColumn = new DataGridColumn("FILE_NAME");
myGrid.addColumn (COL_PDFURL);
COL_PDFURL.sortOptions = Array.NUMERIC;
COL_PDFURL. Width = 195

var allDatabase:Array = [] ;// contains all users as in xml
var currentDatabase:Array = [] ;// contains users that should be displayed

var _loader:URLLoader = new URLLoader();
var _data:XML = new XML();

_loader.addEventListener (Event.COMPLETE, readXML);
_loader. Load (new URLRequest("EHSSDocs/Database.xml"));

function readXML(event:Event):void
{
_data = new XML (event.target.data);
for each (var in _data.user usr)
{
allDatabase.push ({id: usr.@id, SLNO: usr.@SLNO, DATE: usr.@DATE, PDFURL: usr.@PDFURL});
}
currentDatabase = allDatabase.concat ();
updateList();
}

function updateList (): void
{
myGrid.dataProvider = new DataProvider ();<- i="" don't="" see="" where="" this="" does="">

for (var i: int = 0; i
{
myGrid.addItem ({SL_NO: currentDatabase [i].}) SLNO, DATE: currentDatabase [i]. DATE, file name: currentDatabase [i]. PDFURL});
}

var dp:DataProvider = myGrid.dataProvider; //<- import="" this="">

myGrid.addEventListener (Event:ListEvent.ITEM_CLICK, gridItemClick);
myGrid.addEventListener (ListEvent.ITEM_CLICK, gridItemClick);
function gridItemClick (e:ListEvent): void
{
var urlR:URLRequest = new URLRequest (e.target.getItemAt (e.rowIndex). FILE_NAME)
navigateToURL (urlR, "_blank");
}
}

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

[code]

var itemTextInput:TextInput = new TextInput();  Add to your library and import the class
itemTextInput.move (10, 10);
itemTextInput.addEventListener (Event.CHANGE, changeHandler);
addChild (itemTextInput);

function changeHandler(event:Event):void {}
var arr:Array = dp.toArray ();
var filteredArr:Array = arr.filter (filterDataProvider);
myGrid.dataProvider = new DataProvider (filteredArr);
}

function filterDataProvider(obj:Object,_idx:int,_arr:Array):Boolean {}
var txt1:String = itemTextInput.text;
var txt2:String = obj.item.substr (0, txt1.length);  change element to match one of your column names
If (txt1.toLowerCase () is {txt2.toLowerCase ()})
Returns true;
}
Returns false;
}

Tags: Adobe Animate

Similar Questions

  • How to add the option in the SelectItem during execution

    Hello
    Can anyone help me please with this use case?

    I have a list set to the managed bean as below. I want to add new LOV in list (DROP DOWN 2) "ZZZ" based on the value selected in the DROP DOWN 1 on the same page. So that particular one value selected in the DROP DOWN 1, I want to have this new LOV displayed in the DROP DOWN 2. I'm doing it through ValuchangeListener, but I'm not able to find how to add the LOV. Help, please.



    USER INTERFACE
    <!-- DROP DOWN 1 -->
    <af:selectOneChoice label="Order Type" id="soc2" required="true"
                                            validator="#{lovManagedBean.orderTypeValidator}"
                                            binding="#{userAuthentication.orderType}"
                                            autoSubmit="true"
                                            valueChangeListener="#{lovManagedBean.orderTypeValueChangeListener}">                    
                          <f:selectItems id="si2" value="#{lovManagedBean.orderTypeItems}"/>
    </af:selectOneChoice>
    <!-- DROP DOWN 2 -->
    <af:selectOneChoice label="Request Type" id="soc1" required="true"
                                            validator="#{lovManagedBean.requestTypeValidator}"
                                            binding="#{userAuthentication.requestType}">
                                          
                                           
                          <f:selectItems id="si1" value="#{lovManagedBean.requestTypeItems}" />
    </af:selectOneChoice>
    Managed Bean code
      public List<SelectItem> getRequestTypeItems() {
        List<SelectItem> list = new ArrayList<SelectItem>();
    
        list.add(new SelectItem("XXX","XXX"));
        list.add(new SelectItem("YYY","YYY"));
       
       
        this.requestTypeItems = list;
         return list;
      }
    
      public void orderTypeValueChangeListener(ValueChangeEvent event ) {
          System.out.println("+++ Calling LOVManagedBean.orderTypeValueChangeListener()");
          System.out.println("Old Value for order type:" + event.getOldValue() );
          System.out.println("New Value for order type:" + event.getNewValue());
          if(event.getNewValue().equals("Time and Expense")){
            //Code to add LOV in drop down
          }
              
        
      }

    You could make it according to the following example:

    Sample.JSPX:



    xmlns:f = "http://java.sun.com/jsf/core".
    xmlns:h = "http://java.sun.com/jsf/html".
    xmlns:af = "http://xmlns.oracle.com/adf/faces/rich" >




    *
    autoSubmit = 'true' immediate = "true".
    * valueChangeListener = "#{pageFlowScope.SampleBean.onValueChangeListener}" > *.
    **
    **
    **
    *
    * partialTriggers = "soc1."
    * Binding = "#{pageFlowScope.SampleBean.selectOneChoice2}" > *.
    *
    * id = "si3" / > *.
    **



    * SampleBean.Java: *.

    import java.util.ArrayList;
    import java.util.List;

    Import javax.faces.event.ValueChangeEvent;
    Import javax.faces.model.SelectItem;

    Import oracle.adf.view.rich.component.rich.input.RichSelectOneChoice;

    public class SampleBean {}
    Private RichSelectOneChoice selectOneChoice2;

    public SampleBean() {}
    DataSource.Add (new SelectItem ("XXX", "XXX"));
    DataSource.Add (new SelectItem ("YYY", "YYY"));
    System.out.println ("to the constructor");
    }

    Private list datasource = new ArrayList ();
    private SelectItem newSelectItem = new SelectItem ("ZZZ", "ZZZ");

    * public Sub onValueChangeListener (ValueChangeEvent valueChangeEvent) {*}
    * if (valueChangeEvent.getNewValue () .equals ("Add") == true) {*}
    * System.out.println("::: Adding new select item choice"); *
    * datasource.add (newSelectItem); *
    *} else {*}
    * if (valueChangeEvent.getNewValue () .equals ("JustSelect") == true) {*}
    * System.out.println("::: Removing the added select item choice"); *
    * datasource.remove (newSelectItem); *
    * System.out.println (datasource.size ()); *
    *}*
    *}*
    * this.selectOneChoice2.setValue (datasource); *
    *}*

    public void setDatasource (the list data source ) {}
    This.DataSource = data source;
    }

    public getDatasource() {list
    Returns the data source;
    }

    public void setSelectOneChoice2 (RichSelectOneChoice selectOneChoice2) {}
    this.selectOneChoice2 = selectOneChoice2;
    }

    public RichSelectOneChoice getSelectOneChoice2() {}
    Return selectOneChoice2;
    }
    }

    * Ensure that the bean is saved in pageFlowScope.*

    Thank you
    Nini

  • HOW TO ADD THE OPTION ' SEND TO '?

    HOW TO ADD A DESTINATION TO THE OPTION ' SEND TO ' WHEN I CLICK ON A FILE RIGHT?

    How to remove and restore the value default Windows 7 send to Menu items
    http://www.SevenForums.com/tutorials/45421-send-context-menu-remove-restore-default-items.html
     
     

     
  • How to add the 'search' tab in the .chm file

    Search_option.jpg

    Hi all

    All of these days, I was using HR - 5 to create the .chm file. Today, I went to HR - 9. The chm file had the option to search automatically activated in HR - 5. But in RH - 9, glossary option only is available and I am not able to add the adjacent "Search" tab at the tab Index. Please refer to the screenshot for more details.

    Please help me solve this problem that the customer expect tab "Search" for sure.

    Kind regards

    Lata

    Hi Lata

    What show you in your image is a mismatch. The tab says glossary, but the content of the show search tab.

    I think that in this case I suggest you try to define a new window with the attributes you need. Then configure the default window for the page layout that you are using.

    You define the window by:

    1. ensure that Microsoft HTML Help is the default layout.

    2. click on display > pods > project implemented and you should see the windows there.

    See you soon... Rick

    Useful and practical links

    Wish to RoboHelp form/Bug report form

    Begin to learn RoboHelp HTML 7, 8 or 9 in the day!

    Adobe Certified RoboHelp HTML Training

    SorcerStone blog

    RoboHelp EBooks

  • How to add the name of the title of graph in Excel

    Dear friends

    I'm using LabVIEW 8.0.I need how to add the name of the title of graph in Excel.

    You have the report generation tool? If so, the VI of graph Easy Excel has an entry for this.

    If you don't have the Toolbox, then you need to use ActiveX. Please do a search on the use of the ActiveX (there are examples provided with LabVIEW) to control Excel. Also, there are many examples in the thread Excel. NOTE: DON'T POST QUESTIONS IN THIS THREAD.

    In the end, you will need to search for information contained in MSDN.

  • 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;

  • How to add the date felxfiled in OFA

    How to add the date felxfiled in OFA

    Hi gurus,

    How to add a date in the form OFA field. I tried but no optin schedule it. I need to add the calendar options before the flexfiled.

    Concerning

    Hello

    Allocate FND_STANDARD_DATE segment value your FDF everywhere where you want to see the calendar on the page of the OFA.

    Let me know if you need more help on this.

    Kind regards

    Hemant

  • How to add the blank page to existing Document in Adobe Dc

    How to add the blank page to existing Document in Adobe Dc Pro

    Hi thashrifs16749461,

    You can add a blank page using Adobe Acrobat DC by following the instructions below:-

    (1) open your PDF in Acrobat DC.

    (2) choose the form of option "Organize the Page" of the tool pane on the right as shown below in the screen shoot.

    (3) now, at the top, you will see all the tools to organize the page, click "Insert" & select 'White Page' in the drop down menu to insert blank pages.

    * Shortcut: If you are using a windows computer you can use the key "Shift + Ctrl + T" to insert blank pages.

    In case if you have any problem or have any questions please let us know. We will be happy to help you.

    Kind regards

    Nicos

  • How uncheck you the option buttons in Adobe Acrobat Pro XI?

    How uncheck you the option buttons in Adobe Acrobat Pro XI?

    OK, so I have a three sets of radio buttons each three choices, so, basically, it looks like this

    Cheques:          (    )          (     )          (     )

    Deposit slips: () ())

    Envelopes:        (    )          (     )          (     )

    In case anyone is confused, () are radio buttons. Basically, I want radio buttons to act as check boxes, I want to be able to click them and outside. I don't want us boxes because I want them to be circles and not square. Is there a way to do this? Maybe using javascript, what code would be?

    Radio button names: QTY.

    XQTY

    XPrice

    Thanks in advance guys

    You don't have to use a script. I rarely use the option button because they cannot normally be deselected once in the Group has been selected, but here's a backdoor method I use in the mouse event to the top:

    Uncheck the box if the SHIFT key is pressed while clicking on

    If (event.shift) event.target.value = "Off";

    The user will know that it is available. You can also configure a button that resets the value of the button to "Off".

    Another option is to add another choice, as "not applicable".

  • How to add the symbol for the brand to use?

    I saw how to add copyright and brand symbols, but anyone know how to add the symbol of the brand to use (SM)?

    Thank you.

    Mac OS > FInder > edit > special characters > type of service in the lower-right search

    Problem is many fonts do not have this, then you might want to set an exhibitor SM.

  • How to add the table radio button.

    Hello

    I want to update the record if I want that an option of button raduio shaped tabular .There is no option for tabular.
    How to add the table radio button.


    Thank you

    Published by: 805629 on February 3, 2011 04:56

    Use APEX_ITEM. BOX API in the definition of SQL query for the form of tables

  • How to add the user to the Group?

    HY,
    Let's say I'm new to application Express 3.2.1 :)... I searched for exmple or no matter how how to add the user in the Group (at the level of the PL/SQL application).
    I know wwv_flow_group_users Traoré is an opinion not a table. I also know thet CREATE_USER_GROUP procedure create us group, and with the CURRENT_USER_IN_GROUP function, we see if the user is in the selectet group.

    But again, my question is how to add the user to the Group?

    Thank you
    Andrej

    Published by: user10719915 on October 16, 2009 12:18 AM

    Hello

    It will be colon delimited.

    Concerning

    Paul

  • How to disable the option to find my phone, if I phone 4S dead?

    How to disable the option to find my phone, if I have Iphone 4S dead? I turned on Itunes and I wanted to restore it, but it's impossible because I find my iphone app is on. Synchronization is impossible

    If the iPhone is dead, how do you plan on catering?

    You can disable FindMyiPhone by logging iCloud.com.

    -> iCloud: remove your device to find my iPhone

  • How to disable the option for children to receive messages from my iPhone on their iPhones?

    How to disable the option for my children to receive my iPhone imesages on their iPhones?

    Do not share account iCloud with them. iCloud accounts are not meant to be shared.

  • How to change the options in the menu of Run time during the execution of labView

    Hello Hello,

    I m using LabView 8.5.How to change the options in the menu Run time for any control during execution of Labview

    Thank you

    JAI

    Hi Jai,

    Try the below attached VI and let me know if you still need some explanation.

    Rgds,

    Vinciane

Maybe you are looking for