How to add Search (Filter) option to my existing code?

Hi,
The following code works great. Just I want to add a Text Box to search the desired item from the huge list. Please help me in this regard. I would like to pay in return for any help & support provided as 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 like in xml
var currentDatabase:Array = [];// contains users that need to 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 usr in _data.user)
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 the following code may resolve the problem. But don't know how to modify it since I am retrieving data using 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() == txt2.toLowerCase()) {
return true;
return false;
Thanks in advance for any help.

Still, There is no result shows in the DataGrid. The entire code is as below:
import fl.data.DataProvider;
import fl.controls.dataGridClasses.DataGridColumn;
import flash.events.Event;
import flash.net.URLRequest;
import fl.events.ListEvent;
import fl.controls.TextInput;
var COL_IDNO:DataGridColumn = new DataGridColumn("SL_NO");
myGrid.addColumn(COL_IDNO);
COL_IDNO.width=30
var COL_TAGNO:DataGridColumn = new DataGridColumn("TAG NUMBER");
myGrid.addColumn(COL_TAGNO);
COL_TAGNO.width=100
var COL_DESCRP:DataGridColumn = new DataGridColumn("DESCRIPTION");
myGrid.addColumn(COL_DESCRP);
COL_DESCRP.width=260
var COL_PDFURL:DataGridColumn = new DataGridColumn("FILE_NAME");
myGrid.addColumn(COL_PDFURL);
COL_PDFURL.sortOptions = Array.NUMERIC;
COL_PDFURL.width=125
var allDatabase:Array = [];// contains all users like in xml
var currentDatabase:Array = [];// contains users that need to be displayed
var _loader:URLLoader = new URLLoader();
var _data:XML = new XML();
_loader.addEventListener(Event.COMPLETE, readXML);
_loader.load(new URLRequest("AdditionalJobs/Database.xml"));
function readXML(event:Event):void
_data = new XML(event.target.data);
for each (var usr in _data.user)
allDatabase.push({id: usr.@id, IDNO: usr.@IDNO, TAGNO: usr.@TAGNO, DESCRP: usr.@DESCRP, 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].IDNO, "TAG NUMBER": currentDatabase[i].TAGNO, DESCRIPTION: currentDatabase[i].DESCRP, FILE_NAME: currentDatabase[i].PDFURL});
var dp:DataProvider=myGrid.dataProvider; // <- import this class.
//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");
var dp:DataProvider = new DataProvider ();
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["TAG NUMBER"].substr(2, txt1.length);
if (txt1.toLowerCase() == txt2.toLowerCase()) {
return true;
return false;
The following is the XML Code (Database.xml):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Database>
<user id="1" IDNO="01" TAGNO="103-C" DESCRP="Inspection of 103-C" PDFURL="AdditionalJobs/103-C.pdf" />
<user id="2" IDNO="02" TAGNO="203-C" DESCRP="Inspection of 203-C" PDFURL="AdditionalJobs/203-C.pdf" />
<user id="3" IDNO="03" TAGNO="303-C" DESCRP="Inspection of 303-C" PDFURL="AdditionalJobs/303-C.pdf" />
<user id="4" IDNO="04" TAGNO="403-C" DESCRP="Inspection of 403-C" PDFURL="AdditionalJobs/403-C.pdf" />
</Database>
Thanks.

Similar Messages

  • How to add the new dep area in existing cod

    Dear all,
    how to add the new dep area in existing cod we are planing to implement the IFRS by using leading ledger and non leading ledger present we are using OL leading ledger
    present we are using dep area 01 ,15
    how to achive the parallel accounting in asset accounting how to add new dep area 30 in existing COD
    if any document plz refer me  

    Hi Bhayyapu,
    Please refer to the links given below.
    New Depreciation area
    Adding a New Depreciation Area to Existing Assets - Financial Accounting (FI) - SAP Library
    Hope this will help you.
    Regards
    Eugene

  • How to Add a filter option for a entire table to a search button?

    Hi all,
    I am new to SAPUI5. i am having a table with hard coded data's.and i have a search field.
    i want to add a filter option to the search field for the entire table..
    i can able to add a filter option to the column by using filterProperty.
    is there is any method or property to do that?
    PS - i have attached my table code.
    Regars
    Dayalan

    Hi Dayalan,
    documentation for filtering and sorting is in this section of the Developers Guide.
    Cheers
    Graham Robbo

  • How to add search criteria options in CRM UI?

    Dear all,
    we`ve recently updated to SolMan 7.1 SPS10 (source was SPS04). Now I`m struggling a bit with adding
    an additional search criteria to the Incident Management Search View.
    I already considered OSS Note 1918128 (same Title as this thread) and I was able to check this in our - not yet updated - Productive System
    where this has been implemented already.
    Adding the Object /AICRM/PROJECT_ID to the customizing table BTQSRVREQ in SPRO with some Operators didn`t make the trick
    See attached Screenshot.
    Can you please assist me how I can add an additional Search Criteria to the Icident Management Search context (selectable/Operators etc.?).
    Reason behind is - we`d like search for open / closed incident for certain Projects as filter criteria.
    In Addition it would be also great to know - How the Incident Management Standard View / Table can be extended
    by the column "Project ID".
    The Project ID itsself is already linked a new created Icident - hence I`m able check the Project assignment by opening
    a specific Icident and personalize the view.
    regards and many thx in advance
    Benjamin

    Hi Benjamin,
    Enhancing the one order framework search is a common topic available on a lot of threads and blogs, hence I will add a link here :
    SAP CRM Technical Tutorials by Naval Bhatt.: How to enhance Opportunity search for a custom date type
    You can refer to this blog for help but lastly it's all debugging and trying that will help you achieve this in your scenario
    /Hasan

  • How can add search address option in MapKit.framework?

    Hello All,
    I want to make a MKMapView to get a user *current Location* and also he can find location *search by address*.
    Please guide me.

    Qickly changed Tramps to Gramps?
    To place a google map in your site, have a look here http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=2187524. This will enable you to place a pin on your address.
    To have your address placed in a google.com hosted site, you will need to Google the subject.
    Tramps.
    Oopps
    Gramps

  • How to add search help for standard field LIKP-TRAID

    Hi friends,
    How to add search help for standard field LIKP-TRAID ,
    refer screen
    Program Name       SAPMV50A  
    Screen Number      2108      
    TrnsIDCode ( LIKP-TRAID ) ..
    I need to add a search help, so that i can retrieve data from Ztable.
    Thanks.
    Abhi

    Hi Abhi,
    Try using any one option:
    Create a Search Help in SE11.
    Now Goto SE11 -> Enter Ztable -> Select that field -> Click Search Help and try to assign the created Search help to that field in your Ztable explicitly
    OR
    Create a Zdata element in SE11.
    In Data Element, under Further Characteristics tab, enter Name  Parameters of Search Help.
    Assign this data element to that field in ur Ztable.
    OR
    Create a Zdomain and maintain a Value Table or Fixed Values for it.
    Assign this domain to that field in ur Ztable.

  • How to add search help to custom infotype listbox??

    Hi All,
    How to add search help to custom infotype listbox??
    Thanks in advance

    Hi Vinay,
    We have search help and list box as 2 different options.
    At a time we can make a field a list box or a search help.List box is restricted and we can pick values from the defined list whereas in search help we can allow more entries and then validate the value entered later.
    Implementing a listbox or search help in infotype is same as that of implementing it in a modulepool .
    for search help..we can create a custom search help or check for existing search help in se11
    then in the screen on infotype field..assign the search help direcly at the screen painter level..
    double click on the field in screen painter -> change mode and then in the space for "search help" enter the search helps name
    for list box..in the screen painter ,make sure the field is selected as list box..then in PAI of screen we do a
    (Process on value-request..field fieldname module module name)..check syntax and other details...
    Using function module vrm_set_value fill the field and populate it as required
    Pls check and revert
    Regards
    Byju

  • CLM How to add search-help for extension field(New Company Field) in MA.

    Hi all,
         Based on demand,I need to extend a new field(Company) in Master Agreement.
    But I do not know how to add search-help for this field,just like User Accont page.
    Anyone can help me ?thank you very muck.
    Regards,
    JackyCheng

    Hello Jacky,
    To combine all the answers above and have a topic-based reply please go through the below steps:
    #1. Inactivate the current extension field Company (I see it is actually a String value and this is not what you want to have)
    #2. Go to Setup -> System Setup -> Extension Reference Types
    Check if you already have a Company reference type
    If not, create a new Extension Reference Type for Class Company. Fill in all required information.
    #3. Create a new Extension Attribute
    Select Data Type: Object Reference
    Now you can add the Company type as reference
    Regards,
    Bogdan Toma

  • How to add search help to a report.

    How to add search help to a report.

    Hi
    It can use the event AT SELECTION-SCREEN ON VALUE REQUEST:
    PARAMETERS: P_FIELD LIKE ....
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FIELD.
    * Here it needs to insert the abap code to call the search help,
    * for example it can call fm F4IF_FIELD_VALUE_REQUEST
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
           EXPORTING
               TABNAME        = SPACE
                SEARCHHELP = <SEARCH HELP>
                DYNPPROG     = SY-REPID
                DYNPNR          = SY-DYNNR
                DYNPROFIELD = 'P_FIELD'.
    Max

  • How to add a filter like TIME NOW() - {interval}

    How to add a filter like
    TIME > DATEADD(Now(),0,0,0,0,0, -[PARAMETER:interval],0)
    where TIME is a field, interval is paramter in seconds (may > 60)
    or
    a calculated field:
    TIME2=DATEADD(TIME, 0,0,0,0,0,[PARAMETER:interval],0)
    and a filter
    TIME2<Now()
    or a filter
    TIME is within a time interval previous [PARAMTER:interval] minutes

    DateAdd(receiveInput_TS,0,0,0,1,0,CreditTime,0)
    Using the same example in the PDF (data object layout) - the above "formula" worked for me. Note that if you use the above formula - it would be evaled only once, not periodically at every 5 secs or so. In order to achieve -real-time-alert-evaluation- you have to use 'ActiveNow' with the timefield in "alert"
    Alternate - the above calculation also worked correctly in the ADC dataobject layout design as calculated field. But again it will be evaluated only if the data in 'that' row changes.

  • How to add a phone number to an existing contact o...

    Hi all,
    Should be simple but apparently it is not: how to add a phone number to an existing contact on the E71 ?
    I can not believe Nokia made a mess out of such a simple, basic function!
    dovale 

    I just want to add another telephone number to an existing contact. I don't want to Add detail, Edit label, etc., just to add another telephone number! Simple.
    Apparently  the solution is this:
    On main screen write any number 0123456789 >> Press >> Option >> Save to Contacts >> Update Existing (Scroll or name your last saved contact or where you wanted to add new number) then save! 
    It is an amazingly anti intuitive and convoluted solution but I'm afraid that the entire UI of S60 3rd addition is one big UI mess!
    dovale 

  • How to Add Shopping Cart items to an existing PO

    hai friends
    how to Add Shopping Cart items to an existing PO
    Regards
    Emil

    Hi,
    go to the Manage PurchaseOrder
    (BBP_POC) transaction.
    Then, I enter the "Item data" tab and I go to add shopping cart item part and click on "Start Search".
    I select one item in a shopping cart appearing in the screen and press "Add to Purchase Order" button.
    BR,
    Disha.
    Do reward points for useful answers.

  • How to add the library of linphone into existing project ?

    How to add the library of linphone into existing project ?

    How to add the library of linphone into existing project ?

  • How to add a new data element for existing table filed(Primary key field)

    Hi Experts,
    How to add a new data element for existing table field(Primary key field)
    For this filed ther is no foreign key relation ships and even check table.
    while activating table it is giving message like below.
    can you help any one to solve this and wil steps to add new dataelement for existing primary key filed of a table.
    Check table (NAMING SPACE/TABLE NAME(EX:/TC/VENDOR)) (username/19.02.10/03:29)           
    Primary key change not permitted for value table /TC/VENDOR
    Check on table  /TC/VENDOR resulted in errors              
    Thanks
    Ravi

    Hi,
    Easiest way is to download the table eg into an Excel table (if possible) or text table. Drop the table from the database. Build your table with the new key field. Build the database table again and fill it.
    You can do it also over the database into a new table. Drop the old one. Build the enhanced one and fill it. Afterwards drop your (temporary) table.
    Maybe there are other ways, but this works.
    Success,
    Rob

  • How to add an unique column to an existing table?

    How to add an unique column to an existing table?
    I have a large table which has no unique constraint. and I want to add an unique column for it. How to do it?
    Does adding a sequence is a good choice? How to do it?
    Thank you

    Hi,
    alter table tablename
    add constraint contraint_name unique (columnname);but before that you need to check in the table.column there is no duplicate record exist.
    Does adding a sequence is a good choice?
    Your talking about unique constraint then yes.
    Regards,
    Taj

Maybe you are looking for