How can i extend the filter function to also include an option to select which column to filter on?

Hi.
I have built an spry test-page (testing it on my localhost  so i cannot give you direct access to it) here i have an XML file that i show in an dynamic/ repeat table with 5 columns.
I hvae included an spry filter function to easy filter out records, but the code only allows me to filter on one of the columns.
I would like to add an extra "select-menu" to define which column the filter should be active for, how can i do that
Here is the filter code and also the html code for the select-menu and the box to type in what to filter.
The bold parts is the important parts, i would like the options values from the select menu to be inserted in the filterData function to be able to define which column to do the filtering on.
var ds1 = new Spry.Data.XMLDataSet("report3.xml", "orders/order", {sortOnLoad: "@id", sortOrderOnLoad: "descending"});
ds1.setColumnType("date", "date");
ds1.setColumnType("BUTIKNR", "number");
ds1.setColumnType("EXTRAFRAKT", "number");
ds1.setColumnType("job/@idx", "number");
var jobs = new Spry.Data.NestedXMLDataSet(ds1, "job");
function FilterData()
    var tf = document.getElementById("filterTF");
    var menu = document.getElementById("searchIdent");
    if (!tf.value)
        // If the text field is empty, remove any filter
        // that is set on the data set.
        ds1.filter(null);
        return;
    // Set a filter on the data set that matches any row
    // that begins with the string in the text field.
    var regExpStr = tf.value;
    if (!document.getElementById("containsCB").checked)
        regExpStr = "^" + regExpStr;
    var regExp = new RegExp(regExpStr, "i");
    var filterFunc = function(ds, row, rowNumber)
        var str = row["@id"];
        if (str && str.search(regExp) != -1)
            return row;
        return null;
    ds1.filter(filterFunc);
function StartFilterTimer()
    if (StartFilterTimer.timerID)
        clearTimeout(StartFilterTimer.timerID);
    StartFilterTimer.timerID = setTimeout(function() { StartFilterTimer.timerID = null; FilterData(); }, 100);
html:
            <select name="searchIdent" size="1" id="searchIdent">
                <option value="@id" selected="selected">ID</option>
                <option value="date">DATUM</option>
                <option value="time">TID</option>
                <option value="BUTIKNR">BUTIK</option>
                <option value="REF">REFERENS</option>
              </select>
          <input type="text" id="filterTF" onkeyup="StartFilterTimer();" />
Contains:
  <input type="checkbox" id="containsCB" /></td>
Thanks in advance.
//Rickard H

Now it works, i had to do it like this:
    var filterFunc = function(ds, row, rowNumber)
        var str = row["@id"];
        if (str && str.search(regExp) != -1)
            return row;
        var str1 = row["date"];
        if (str1 && str1.search(regExp) != -1)
            return row;
        var str2 = row["time"];
        if (str2 && str2.search(regExp) != -1)
            return row;
        var str3 = row["BUTIKNR"];
        if (str3 && str3.search(regExp) != -1)
            return row;
        var str4 = row["REF"];
        if (str4 && str4.search(regExp) != -1)
            return row;
        return null;
I also had to remove the line "ds1.setColumnType("BUTIKNR", "number");" from the code, otherwise it would not search at all (only searches string types?).

Similar Messages

  • How can i extend the table control while transfering the data

    hi
    how can i extend the table control while transfering the data.

    Hi,
    For table control we have to handle the page down (P+, or what ever function codes are assigned to that activity) activity with our coding.
    Just check out this code:
    This is the bdc to update the XK01 transaction code (Vendor Creation).
    Here we will use table controls for bankings. Here Iam sending the coding and text files.
    Coding
    REPORT zprataptable2
    NO STANDARD PAGE HEADING LINE-SIZE 255.
    DATA : BEGIN OF itab OCCURS 0,
    i1 TYPE i,
    lifnr LIKE rf02k-lifnr,
    bukrs LIKE rf02k-bukrs,
    ekorg LIKE rf02k-ekorg,
    ktokk LIKE rf02k-ktokk,
    anred LIKE lfa1-anred,
    name1 LIKE lfa1-name1,
    sortl LIKE lfa1-sortl,
    land1 LIKE lfa1-land1,
    akont LIKE lfb1-akont,
    fdgrv LIKE lfb1-fdgrv,
    waers LIKE lfm1-waers,
    END OF itab.
    DATA : BEGIN OF jtab OCCURS 0,
    j1 TYPE i,
    banks LIKE lfbk-banks,
    bankl LIKE lfbk-bankl,
    bankn LIKE lfbk-bankn,
    END OF jtab.
    DATA : cnt(4) TYPE n.
    DATA : fdt(20) TYPE c.
    DATA : c TYPE i.
    INCLUDE bdcrecx1.
    START-OF-SELECTION.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    filename = 'C:\first1.txt'
    filetype = 'DAT'
    TABLES
    data_tab = itab.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    filename = 'C:\second.txt'
    filetype = 'DAT'
    TABLES
    data_tab = jtab.
    LOOP AT itab.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RF02K-KTOKK'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'RF02K-LIFNR'
    itab-lifnr.
    PERFORM bdc_field USING 'RF02K-BUKRS'
    itab-bukrs.
    PERFORM bdc_field USING 'RF02K-EKORG'
    itab-ekorg.
    PERFORM bdc_field USING 'RF02K-KTOKK'
    itab-ktokk.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFA1-LAND1'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'LFA1-ANRED'
    itab-anred.
    PERFORM bdc_field USING 'LFA1-NAME1'
    itab-name1.
    PERFORM bdc_field USING 'LFA1-SORTL'
    itab-sortl.
    PERFORM bdc_field USING 'LFA1-LAND1'
    itab-land1.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFA1-KUNNR'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFBK-BANKN(01)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTR'.
    cnt = 0.
    LOOP AT jtab WHERE j1 = itab-i1.
    cnt = cnt + 1.
    CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
    PERFORM bdc_field USING fdt jtab-banks.
    CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
    PERFORM bdc_field USING fdt jtab-bankl.
    CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
    PERFORM bdc_field USING fdt jtab-bankn.
    IF cnt = 5.
    cnt = 0.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFBK-BANKS(01)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=P+'.  " Page down activity
    PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFBK-BANKN(02)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTR'.
    ENDIF.
    ENDLOOP.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFBK-BANKS(01)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTR'.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFB1-FDGRV'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'LFB1-AKONT'
    itab-akont.
    PERFORM bdc_field USING 'LFB1-FDGRV'
    itab-fdgrv.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFB1-ZTERM'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFB5-MAHNA'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'LFM1-WAERS'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'LFM1-WAERS'
    itab-waers.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RF02K-LIFNR'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTR'.
    PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=YES'.
    PERFORM bdc_transaction USING 'XK01'.
    ENDLOOP.
    PERFORM close_group.
    **Flat files for the above code***
    Intial screen data file.
    1 63190 0001 0001 0001 mr bal188 b in 31000 a1 inr
    2 63191 0001 0001 0001 mr bal189 b in 31000 a1 inr
    Table control Data:
    1 in sb 11000
    1 in sb 12000
    1 in sb 13000
    1 in sb 14000
    1 in sb 15000
    1 in sb 16000
    1 in sb 17000
    1 in sb 18000
    1 in sb 19000
    1 in sb 20000
    1 in sb 21000
    1 in sb 22000
    2 in sb 21000
    2 in sb 22000
    Regards,
    Kumar.

  • I get a neighbor's wifi on my MacBook in my bedroom.  How can I extend the range to the MacMini in my living room?

    I get a neighbor's wifi on my MacBook in my bedroom.  How can I extend the range to the MacMini in my living room?

    You can't. It's not your network.

  • How can i extend the Apple TV storage to get an 1 TB? apple has any external hard disk or similar?

    how can i extend the Apple TV storage to get an 1 TB? apple has any external hard disk or similar?

    Only AppleTV1 has an internal PATA drive. The largest PATA drive available is 250gb.
    Hacks are available to use the USB port on AppleTV1 to access more storage.
    AppleTV2 does not have an internal drive.
    Why do you need more storage in your AppleTV? iTunes streams video to AppleTV so no need to store it locally.

  • How can I extend the range of my chart?

    I've asked this question before on here, and found that shift-clicking for more cells has usually worked, but I have now run into a new problem...
    My chart used to cover the range B5:P50. However, since moving a column it now only covers the cell range H5:P50. My chart is on a separate sheet. Usually if I want to add more to the range it will be downwards, so I just click on the chart, then click on the Main Sheet and shift-click to add more cells. Unfortunately, because the range I want is to the left of the highlighted area this time, I can't use shift-click.
    How can I extend the range of my chart so it includes cells to the left of the currently selected range? In Excel I'd be able to just type the range in a box somewhere, rather than all this GUI-based clicking and dragging which is actually more difficult! Is there somewhere I can just type the range in that I want?
    Thanks!

    "I want to add some series that are missing from the chart. How do I do that?"
    Here's a two step process to do that:
    Select the chart to show the the data selection on the associated chart.
    Click in the leftmost column of the data, and drag left to change (move) the selection (blue arrow) for the result below:
    Grab the control handle (small circle) at the bottom right corner of the selection, and drag  right, as indicated by the blue arrow.
    Result shown below.
    Reassign colours and do other formatting as desired.
    Regards,
    Barry

  • HT1689 How can I extend the number of times my phone rings before going to answerphone

    How can I extend the number of times my Iphone 4s rings before it goes to answerphone

    Call you carrier and ask them how you can change this.  The number of rings before voicemail kicks in is set by your carrier.  Some have the option to do it from your phone if you know the sequence of codes to send, but you need to ask your own carrier how to do it for their system.

  • Upon Removing Ubuntu, How can I Extend the C and D Drive in Windows 7?

    Upon Removing Ubuntu, How can I Extend the C and D Drive in Windows 7?
    Previously, my Computer had Windows 7 and Ubuntu as a dual Boot.  I followed some online instructions on how to Delete Grub (Ubuntu's Startup Boot Menu) and Ubuntu Partitions (<edited>) and it worked.  I wanted to expand my remaining C and
    D Partitions, but I couldn't figure out how to do it. 
    Windows 7's Disk Management shows my Laptop's only Disk divided into 3 logical drives ( i.e., the Recovery Drive, C, and D Drives).  The Order of the Drives is Disk 0 is:
        1.46 GB - Recovery Drive
      53.71 GB - C Drive
      42.79 GB - Free Space
    191.19 GB - Drive for my Personal Data/Files
        8.93 GB - Unallocated
    NOTE:  The Free Space and D Drive have a Green Box around them.
    I would like to take the Free Space and Unallocated Space and apportion it between the C and D Drives., as stated prior, I'm not sure how to do this.  Do you have any reliable and
    preferably free options? 

    Hi Bobby Marlee,
    Please share us a screenshot about disk management.
    If my understanding is right, you want to extend the C and D drive by using the free space and unallocated space.
    If you want to use Disk Management to extend the drive space, I think we need to back up the files and delete Free Space, Drive for my Personal Data/Files, and then extend C: drive and create D: drive by using the Unallocated space.
    For more information, please refer to the following article.
    http://technet.microsoft.com/zh-cn/library/cc771473.aspx#BKMK_WINUI
    Best regards,
    Fangzhou CHEN
    Fangzhou CHEN
    TechNet Community Support

  • How can i extend the customer  to other  sales area

    how can i extend the customer  to other  sales area

    Hello Harish,
      Once you have a customer (eg. 100002) in one sales area (eg. 0010/10/10), you open XD01 tcode, enter the same  customer number (100002) in customer field and enter sales area (say u want to create in 0020/10/10) in which you want to create the same customer. Now in Reference section, enter the customer number (100002) and sales area in which already the customer exists (0010/10/10). When you press enter, it allows you to modify the sales area data for the customer for new sales area.
    then save it.
    Hope it is clear...

  • How can I extend the MRP Areas?

    How can I extend the MRP Areas of a material for different warehouses by LSMW? Is there a specific field for it?

    Ok, this is how my recording is built up (it ends with the same screen from the start):
    RMMDDIBE 1000
        BDC_CURSOR                     SO_WERKS-LOW
        BDC_OKCODE                     =UCOMM4
        SO_MATNR-LOW                                        MATNR                matnr
        SO_WERKS-LOW                                        WERKS                plant
        BDC_SUBSCR                     RMMDDIBE
    RMMDDIBE 1000
        BDC_OKCODE                     =CMDM
        SO_MATNR-LOW                                        MATNR                matnr
        SO_WERKS-LOW                                        WERKS                plant
        BDC_SUBSCR                     RMMDDIBE
        BDC_CURSOR                     SO_BERID-LOW
        PANE                           X
        SO_BERID-LOW                                        MRP_AREA             mrp_area
    RMMDDIBE 0101
        BDC_CURSOR                     SDIBE_MASSFIELDS-XLGP
        BDC_OKCODE                     =SAVE
        SDIBE_MASSFIELDS-XDISGR        X
        MDMA-DISGR                                          DISGR                MRP_group
        SDIBE_MASSFIELDS-XDISMM        X
        MDMA-DISMM                                          DISMM                planningskenmerk
        SDIBE_MASSFIELDS-XMINBE        X
        MDMA-MINBE                                          MINBE                bestelpunt
        SDIBE_MASSFIELDS-XDISPO        X
        MDMA-DISPO                                          DISPO                Mrp controller
        SDIBE_MASSFIELDS-XDISLS        X
        MDMA-DISLS                                          DISLS                lotzsize
        SDIBE_MASSFIELDS-XBSTFE        X
        MDMA-BSTFE                                          BSTFE                fixed lotsize
        SDIBE_MASSFIELDS-XSOBSL        X
        MDMA-SOBSL                                          SOBSL                special procurement key
        SDIBE_MASSFIELDS-XLGPRO        X
        MDMA-LGPRO                                          LGPRO                issueing storage loc
        SDIBE_MASSFIELDS-XLGFSB        X
        MDMA-LGFSB                                          LGFSB                stor location external procurement
        SDIBE_MASSFIELDS-XPLIFZ        X
        MDMA-PLIFZ                                          PFLITZ               planlevertrijd
        MDMA-PLIFZX                    X
    RMMDDIBE 1000
        BDC_CURSOR                     PA_PROSA
        BDC_OKCODE                     =ONLI
        SO_MATNR-LOW                                        MATNR                Matnr
        SO_WERKS-LOW                                        WERKS                plant
        PA_PROSA                       X
        BDC_SUBSCR                     RMMDDIBE
        PANE                           X
        SO_BERID-LOW                                        MRP_AREA             mrp_area

  • How can I extend the 2-year search window of Calendar search

    How can I extend the 2-year search window of Calendar search in iPhone 5s ? I basically want 'Search' to search everything in the phone, not just restricted to a 2-year window.

    See my link above... it's a documented limitation...
    Calendar and Reminder search
    Spotlight searches for the title of calendar events and reminders in a two-year window—it will reveal results from one year in the past and one year in the future. If an event has recurrences that fall in this range, it will find the event that is closest to the current date.
    If multiple events have similar details (title, notes, location, and so on) and you search for these details, Spotlight will show the most recent event. To see more results, use search in Calendar or Reminders.

  • My time capsule backup space is full yet, how can i extend the backup space?

    how can i extend the backup space?

    Two possibilities:
    Add a new USB hard drive to the Time Capsule and start a new full backup and move forward from that point.
    (Unfortunately, it is not possible to have Time Machine simply continue backups on a new drive. You have to start over with a new full backup.)
    Or, if you decide that you really do not need all the old backups on the Time Capsule, the disk can be erased and you can start over with a new full backup and move forward.

  • How can i extend the battery life of my iphone 4s? when i left it in standby mode when i saw in 5hours it drains to 5%, i thought when i leave the phone the percent is still the same. whant am i goin to do?

    How can i extend the battery life of my iphone 4s? when i left 50% it in standby mode when i saw in 5hours it drains to 5% i saw 45%, i thought when i leave the phone the percent is still the same. whant am i goin to do?

    I was not aware of the fact one could use ringtones as alarms, this will suffice! Although I foresee some very awkward times as the sound does not stop once I respond to the reminder (it keeps going for good five - ten seconds after I "stop" the reminder), but it's better than missing it altogether!
    Thank you very much!
    Regarding the Alarmed app, doesn't it have to be running to actually remind you?
    -Modular747: I don't know anyone who actually reads the terms of service agreement, those things are usually up to thirty, small print pages full of legal jargon. Rules, I do read - not the legal documents (also they often contradict the laws in my country, but that's a whole different story).
    I agree with you - the average customer support consultant mostly cares about keeping his job and earning his salary (don't we all?) and thus racking up completted tasks (i.e. getting rid of customers as fast as possible - in a good mood). The "threat" none the less is real, if a cell phone causes me more trouble than it is worth, I will indeed throw it away (I have done so before) - and recommend a different brand to anyone willing to listen.
    Don't get me wrong, I love Apple and I've been faithfully using and recommending their producs for twenty years now, not because of fanboyism, but because they earned it. This calendar issue, however, is like a toaster that doesn't automatically eject the toast at the set time. I see it as a major flaw and after googling around a bit I see that it's been around since at least 2007 (THAT'S SEVEN YEARS!!) so I strongly believe they are aware of this problem by now, but are choosing to ignore it for some mysterious reason and it really ****** me off.
    I will send the feedback but based on my observations I suspect the Send button is merely a cleverly disguised Delete button.

  • How can I extend the wireless range on my BT Hub 3

    I currently have the BT hub 3 and find that as I have quite a rambling house and the broadband is located at one side rather than in the middle of the house I cannot get a signal in all areas. This is massively frustration for the children when they wish to do their homework in the peace of their own rooms - how can I extend the range, without having to pay through the nose, but easy enough for someone who is not massively technical? - Thanks in advance

    There are a number of options on my website.
    Wireless connection problems
    and
    Network connection problems and possible solutions
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • Can somebody help how can I extend the carpet sample to fill out the hallway?

    I would need to extend the piece of capret sample to replace the old plane carpet. I'm pretty new to PS and have trouble with the crazy carpet patter plus the room is getting narrower.
    Can somebody give me some tips or any kind of help? I really appreciate it. Thank you!

    Ok, the question is how can i extend the range with
    my airport extreme base,
    With an Airport Express or another Airport Extreme
    I have A netgear WNP802, it
    has a repeating feature.
    Which won't work with your Airport Extreme
    < But i am wanting to have the
    netgear and the apple airport extreme talk to each
    other so that i can put the net gear in a seperate
    room to extend the range of signal. </div>
    This is not possible.
    How can i do this?
    You can't.
    Netgear and Apple use different chips which means they won't and can't talk to each other when it comes to extending networks.

  • How can I hide the borders and keep it as an option?

    How can I hide the borders and keep it as an option?  I had someone go into the css I believe, and make it so there were no borders visible on the page (I could see the dotted outline while working on it, but when pushed, it wasn't visible (which is what I wanted).  They called it "noborders."  Since I had to reinstall, it went away.  Help?
    I have Dreamweaver CS5.5

    Try this site:  CSS Border
    Add code then type in a zero. Later add border size you want.
    examples:  border: 0px solid black;
    or
    border: 1px 000000;
    or
         border-top-style: solid; 0px 000000;
         border-right-style: dotted; 0px 000000;
         border-bottom-style: solid; 2px 000000;
         border-left-style: dashed; 1px 000000;

Maybe you are looking for

  • My old windows is on an external drive, how do retrieve firefox bookmarks that are on the drive?

    I had windows 7 on drive C, now I got new computer with a new windows 7 and I'm using the old drive (C) as an external hard drive, it still has all program files and windows files on it. How do I retrieve my old book marks that are on that hard drive

  • REG: ABAP-HR step by step Material

    Hi friends I am working as a HR Functional Consultant, i turned into ABAP HR Consultant, what the particular scenario we have to do, pls send me this mail ID:[email protected] Regards Prasad

  • Account password reset sent but not received by Outlook.

    I have requested a password reset, went through the process and had success at Apples end. Email was sent but not received by the Outlook account email I have been using for years. Outlook is still working fine. Nothing in Junk folder and have added

  • Photoshop not an option in iPhoto

    I recently installed Photoshop CS4 (and also have Photoshop Elements) and would like to make CS4 my default photo editor in iPhoto. But in iPhoto Preferences/General the only options listed for "Edit Photo" are "In main window"; "Using full screen";

  • Installer does not do anything

    After downloading firefox 8.0 I get the usual run or save question. Select "run". I then get a "Run as" dialogue window that asks whether to run as current user or some other user. As my account is the admin account I choose current user. Then nothin