Change the color of the nodes in the tree based on a regular expression

Dear Experts,

Given:
Sample:
http://Apex.Oracle.com/pls/Apex/f?p=53647:5
Test/test

Information from the workspace
Workspace: ralab
user: test
password: test
application: trees-samples
page: 5

Mandatory
I can change the color of node using jQuery contains() selector based on a value, for example the project
apex.jQuery("#eba_demo_tree").find("a:contains('Project')").css("color","red");
Now, the question:
How can I update the jQuery code to change the node based on a regular expression as
^[P]
or in other words for all the nodes starts with P, the color needs to be changed in red?

Best regards
Mahmoud
$("#eba_demo_tree a").filter(function(index){
   var lRegExp = /^m/i; //or new RegExp('^m', 'i');
   //trim to get rid of leading space due to space in encapsulated ins-element
   return lRegExp.test($(this).text().trim());
});

http://API.jQuery.com/filter/
http://www.w3schools.com/jsref/jsref_obj_regexp.asp
http://www.regular-expressions.info/JavaScript.html

Tags: Database

Similar Questions

  • The z570 has not a regular Express card slot (only a mini one)?

    The z570 has not a regular Express card slot (only a mini one)?

    Hi KiteEye and welcome to the community,

    It doesn't have an Express card slot.

    The small slot located is a memory card reader.

    Dave

  • XQuery insert node and assign the value based on an XPATH expression

    Hello

    I am trying to write a function that receives an XML as input parameters and return updated XML output

    -nodes are removed from the input XML code

    -a node must be inserted and the node value must be 1 or 0, based on an XPATH expression

    I discovered how to remove nodes, I discovered how to insert a new node, but I can not set the value of the conditionally inserted node an XPATH expression.

    Here's my current procedure and below a sample of one XML of entry. I use Oracle 12 c.

    CREATE OR REPLACE FUNCTION STRIP_XML
    (
      IN_XML IN SYS.XMLTYPE
    ) RETURN SYS.XMLTYPE AS
    p_result XMLType;
    BEGIN
      select
          xmlquery(
             'declare default element namespace "http://mad.evs.com/search"; (: :)
              copy $d := .
              modify (
      delete node $d//MainCategory/@logId,
               delete node $d/MainCategory/@id,
    -- a lot more of those delete node
     -- insert a node, but the value 1 is conditional
               insert node <DMZ>1</DMZ> after $d/MainCategory/SDataSection/EventDate)
              return $d'
            passing in_xml
            returning content
            ) into p_result
            from dual;
    
    
      RETURN p_result;
    END STRIP_XML;
    

    The condition for the value of is


    HASPATH (//DigitalAssets/DigitalAsset [@ available = "true" and @videoFormatId = "11"] / VideoLocations/Videorental [@typeId = "8"]) then 1 else 0


    It is complex because DigitalAssets/DigitalAsset is a collection. Here is an example of an XML to entry



    <MainCategory xmlns="http://mad.evs.com/search" id="9" logId="3349" logType="3">
      <Name>Sport</Name>
      <Serie id="163" externalId="557">
      <TitleAKA>UCL 2006/07</TitleAKA>
      <DigitalAssets available="true" som="20:28:49:05" dur="00:02:46:04" videoDurationMinutes="3">
         <DigitalAsset available="true" som="20:28:49:05" dur="00:02:46:04" videoDurationMinutes="3" videoFormatId="3">
            <VideoLocations>
                <VideoLocation id="3" path="003349MA.mxf" typeId="1" locationId="1" priority="0"/>
                <VideoLocation id="3" path="003349MA.mxf" typeId="2" locationId="1" priority="0"/>
                <VideoLocation id="3" path="003349MA.mxf" typeId="5" locationId="1" priority="0"/>
             </VideoLocations>
          </DigitalAsset>
          <DigitalAsset available="true" som="20:28:49:05" dur="00:02:46:04" videoDurationMinutes="3" videoFormatId="11">
             <VideoLocations>
                <VideoLocation id="101" path="003349MA.mpg" typeId="1" locationId="1" priority="0"/>
                <VideoLocation id="101" path="003349MA.mpg" typeId="2" locationId="1" priority="0"/>
                <VideoLocation id="101" path="003349MA.mpg" typeId="8" locationId="1" priority="0"/>
             </VideoLocations>
          </DigitalAsset>
      </DigitalAssets>
      <SDataSection xmlns="http://mad.evs.com/search">
        <EventDate>2006-08-09</EventDate>
        <LogType>3</LogType>
      </SDataSection>
    </MainCategory>
    


    In this case, because HASPATH expression could be set to true, the value of the added node must be 1.


    Any help or advice how I should fight against that would be appreciated. I have no experience with XML and XQuery, I create my function through from trial and error of the doc.


    Thanks and regards, Pierre

    Hi Pierre,.

    You can use the if-then-else statement, like this:

    Insert the node

    {

    If ($d/MainCategory/DigitalAssets/DigitalAsset[@available="true' and @videoFormatId = '11'] / VideoLocations/Videorental [@typeId = '8'])

    then 1

    0 otherwise

    }

    After $d, MainCategory, SDataSection, EventDate

    XSLT can be an alternative to the XQuery Update in this case.

  • Try to change the legend based on the dropdown value

    Two elements are involved:

    The drop-down list called TransactionType - possible values are 'A' 'B' or 'C '.

    Box chkVerification

    I created the javascript code to the change event of the dropdownbox TransactionType

    Form1. #subform [0]. TransactionType::change - (JavaScript, client)

    If (this.rawValue == "A") {chkVerification.caption.value.text.value = "Checking A"}

    ElseIf (this.rawValue == "B") {chkVerification.caption.value.text.value = "Checking B" ;}

    When I check the script syntax sometimes without error, but when I change the value in the drop down the legend of the box never changes.

    What I'm missing here?

    Using app.alert, I think I can see that I need to trigger the script as xfa.event.newText, but the legend is not changing.

    I also tried this: Form1.resolveNode ("chkVerification.Caption.Value. #Text"). Value = "audit has." Is what I'm trying to make even possible?

    The form must be registered as a dynamic PDF form to enable dynamic behavior, including changes to the legend.

    In addition, I find much easier to name pages explicitly. It is less problematic. So rather than going into "form1. #subform [0]. DropDownList1"you access"form1.page1.DropDownList1 ".

    Form1.Page1.DropDownList1::exit - (JavaScript, client)

    var char_ = this.rawValue;

    xfa.resolveNode("form1.page1.CheckBox1.caption.value.#text").value = char_;

    Steve

  • Change the Image based on the line of dashboard

    Hello

    IM using OBIEE 11 G 11.1.1.5

    I need to show a dashboard (Image) the company logo on a line of dashboard. I have 5 companies and each has its own logo. That a company can be selected.

    Is there a way to building that?

    Thank you

    Published by: Andres on 16-ene-2012 12:52

    Hi Andres,

    We can make use of the "conditional display of sections within the dashboard based on the results of the analysis. One option is certainly write different analyses (static text or narrative mode) with your company newspapers and their incorporation in the various sections of their reports in the dashboard. These sections should be displayed conditionally based on the fast one of dashboard. You can create analysis, each read the variable of presentation (associated with the command prompt) and display a record only if you choose a particular company. (Ex: create a business with a single column as @{variables.CompanyPrompt}.) Create a filter on it as "equals 'Oracle'. If this analysis, would post a record only if the presentation variable is set to 'Oracle').

    I would keep you updated if I hit many effective otherwise.

    I hope this helps.

    Thank you
    Diakité

  • How can I the date and time using regular expressions

    Hi all

    I have depolyed filtering the log agent. While setting properties, I would like to recover the file that is generated at the present time, but along the way, I am unable to define, what regular expression that I provide retireves date and time specific file...

    Leave with kindness, men know is it possible to do?

    Thanks in advance.

    Shiva

    This seems to be the same question I can't add a timestamp in logfilter, so I'll answer in this thread. Please check the two wires as "Answered" when the issue has been resolved.

    Kind regards

    Brian Wheeldon

  • Find the words (wild cards) using regular expressions

    I'm testing to see if the words are present for revision 1 of a drawing of the cartridge.

    The script search the digit 1 followed by a date, a title, and 4 sets of initials.

    The number 1 is static, (date, title and original are the cards that they are different for each design).

    I use regular expressions to match the words.

    The regular expression highlighted in blue is the number 1 and the date.

    Him remains highlighted in orange does not match the title and initials.

    If anyone can help with the regular expression that is most appreciated.

    Once I got that work will add the form fields for the initials, noting only the console at this point for the tests.

    numWords = this.getPageNumWords (0);

    number of words on the page

    loop through the words on the page

    for (var j = 0; j < numWords-1; j ++)

    {/ / get the pair of words to test}

    ckWords = this.getPageNthWord (0, j) + ' ' + this.getPageNthWord (0, j + 1); test words

    Check if 1 26.05.16 THE STRENGTHENING REVISED MM SB AE GM word string is present

    If (ckWords.match(/ ^ 1\s [0-9] {1,2}.)) [0-9] {1,2}. [0-9] {2} \s\w+(\s+\w+){1,7}/))

    {

    Console.println (ckWords);

    }

    }

    You can use something like this:

    ckWords = this.getPageNthWord (0, j) + ' ' + this.getPageNthWord (j, 0, + 1) + ' ' + this.getPageNthWord (0, + 2 j) + ' ' + this.getPageNthWord (0, j + 3) + ' ' + this.getPageNthWord (0, j + 4) + ' ' + this.getPageNthWord (0, j + 5) + ' ' + this.getPageNthWord (0, j + 6);

    If (! ckWords.match (/ ^ 1\s\d {1,2} \.\d {1,2} \.\d {2} \s\w+ (?:-s + \w +) {1.8} \s([A-Z]{2})\s([A-Z]{2})-s ([A - Z] {2}) \s([A-Z]{2})$ /)) ckWords + ckWords + "" + this.getPageNthWord (0, j + 7);

    If (! ckWords.match (/ ^ 1\s\d {1,2} \.\d {1,2} \.\d {2} \s\w+ (?:-s + \w +) {1.8} \s([A-Z]{2})\s([A-Z]{2})-s ([A - Z] {2}) \s([A-Z]{2})$ /)) ckWords + ckWords + "" + this.getPageNthWord (0, j + 8);

    If (ckWords.match (/ ^ 1\s\d {1,2} \.\d {1,2} {2} \s\w+ \.\d (?:-s + \w +) 1.8 ([A - Z] {2}) \s([A-Z]{2})\s([A-Z]{2})\s {} \s([A-Z]{2})$ /))

    {

    ...

  • By default, Labview 8.6 places conventional controls on the front panel; Is it possible to change the default settings to modern or Express possible?...


    The default value is of modern controls and I always change to classic.

    I am classic and the classic controls are much easier to adapt to what I want.

    options GOTO and look along all tabs to find the place where the new vi is adjustable and modern controls by default

    But keep in mind only new i's, old vi must be changed in the properties of this vi.

    Guilbert

  • How to change the report based on users?

    Hi all

    I've created a report based on a table. Based on the users (Administrator, user), I want to change my appearance of report. But users are not available in this table. Users are not available in this area table.Common available.

    Req: If I enter as a user I want to not see that my documents.

    If I enter an admin I want to see all users folders.

    How to solve this problem.

    Please explain in detail.

    Thank you and best regards,

    Rambeau

    Hai raghu, pls mark closed this issue.its as a response!

  • Change the Linux based VM scsi controller

    Hi all

    I have a strange problem with a Linux based VM. The virtual machine is currently set up with free adapter, I add another drive connected using Buslogic and the virtual machine boot more.

    Y at - there a Posibility to specify the startup disk?

    Thank you!

    Check if the comments BIOS setting is like this:

    AWo

    VCP 3 & 4

    Author @ vmwire.net

    \[:o]===\[o:]

    = You want to have this ad as a ringtone on your mobile phone? =

    = Send 'Assignment' to 911 for only $999999,99! =

  • change the display based on data

    Every time "ok" [keyword] appears, "BOLD" before it which date. Data are from a stream.

    Example:
    Today, March 23, 2010, it's ok.
    Yesterday, January 2, 2009, ok.
    Tomorrow will be held May 14, 2011, ok.

    Result: Today is March 23, 2010, ok.
    Yesterday, January 2, 2009, ok.
    Tomorrow will be held on May 14, 2011, ok.

    So far...
    < CFSET #ReplaceNoCase(variable, "<ok.", "", "ALL") = variable # >
    Since duration varies every time: find two points and two places before the key word and then "BOLD"

    Help please?

    Have you tried the reReplaceNoCase tag? The ', \s*ok ' in the first parameter and the ', ok ' in the second parameter, handling the OK of your requirement.

  • Change the report based on the selected value frm the prompt

    Hello

    I have a requirement where we invite dashboard that has three columns namely year, month, and report the name.
    The user will choose the name at the prompt report, once made the report that was selected should appear
    on the dashboard page and he should be able to select the data on the basis of the month and the year of it.

    Also, if the user wants to go to the other report it should be able to select in the guest and view it.

    Pls enlighten us on the way of progress on this issue. From now on, think that if something like this is possible, then it would definitley
    need two prompts a report name and one for the month and the year.

    THX :)

    Are you looking for this?

    http://oraclebizint.WordPress.com/2008/01/17/Oracle-BI-101332-selecting-reports-from-Dashboard-prompts-and-guided-navigation-sections/

  • You can change the number of products per row for tablet or a phone?

    Hey everybody, I build e-commerce for a business that has a web site that change the layout based on browser width. I use their model and for the life of me I can't understand how to keep the products of overlap between them when the width of the site changes.

    Take a look at what I'll talk HERE.

    Any help would be great...

    Thank you guys!

    Hello eric_413,

    http://helpx.Adobe.com/business-catalyst/KB/tags---quick-reference.html#id_85087

    Look at the overall plan for the online store layouts > cataloguelist tag, you can export the catalog list and the list of products in an unordered instead of tables list.  Here's what I have in my sensitive layouts:

    {tag_cataloguelist, true true, 3,}

    You may need to change some CSS, but it works best for the provisions of reactive.

    Hope this helps,

    Chad Smith | http://bcgurus.com/Business-Catalyst-Templates for only $7

  • Change the navigation target based on the value of the coast

    Hi, strange requirement. I have a report of responses which shows groupings level high information costs (labor, fringe, travel, etc.). I want to allow users to navigate to reports of transactions detailed illustrating each transaction striking a cost group. However, the fields I want to show to 'work' (employee ID, name, jobcodes) transactions are different then what I want to show for 'travel' transactions (destination, etc.).

    So I created operations detailed for each types of group cost - no worries.

    Now, what I would really like to do is this: I want to change the property "interation of value" to access the reports detailed transactions. But I want to change the target based on the group. For example, if no one clicks on the 'work' - I don't want which they then select to navigate to work, travel, fringe, reports etc.. I want that it change something the target, so it "knows" to go to the work report.

    Is there a way to do this?

    Thanks in advance!
    Scott

    The first part could give you an idea how to achieve your goal, you should use a conditional drill.
    http://oraclebizint.WordPress.com/2008/03/05/Oracle-BI-EE-101332-conditional-drills-and-dynamic-tool-tips-HTML-formatting-and-go-URL/

    based on your rek... your statement box decided who report to go...

  • Help in regular Expression for the beaches of limitation

    Hi, I'm working on the provision of a text field is limited to dates, it's just a part of the code. I already have the validation of the dates, but I am now limiting what the user enters using a regular expression. This code works a little however, it does not limit me for example I can enter more than 2 digits, but then he limits based on the total amount allowable so for example 8 digits are allowed if I just type. I need to stop after 2 digits then have a - then 2 other numbers then one - and then followed by 4 digits. I tried to limit each section and grouping as well. Any help would be greatly appreciated. Thank you.

    It is in the format code and I am the appellant in the key sequence.

    function DateKS () {}

    var value = AFMergeChange (event);

    If (! event.willCommit) {}

    Allow only characters that match the regular expression

    Event.RC = /^([0]{0,1}[1-9]{0,1}|[_1]{0,1}[012]{0,1}) ([-] {0,1}) ([0] {0,1} [1-9] {0,1} |) [12] {0,1} [0-9] {0,1} | ([3] {0,1} [01] {0,1}) ([-] {0,1}) ([0-9] {0,4}) $/ .test (value);

    }

    }

    I decided that control for 100 and 400 was not necessary because this event does occur that all 400 years. But I'm working on it further and changed even more. Here is my code to work.

    function isLeapYear (year) {}
    year return % 4 = 0;
    }

    function checkDaysInMonth (day, month, year) {}
    daysInMonth var = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

    If (month = 2) {}
    If (isLeapYear (year)) {}
    daysInMonth [1] += 1;
    }
    }

    return daysInMonth [month - 1] > = day;
    }

    function checkDateFormat (dateStr) {}
    var errorMsg = ",
    maxYear = (new Date()) .getFullYear (),
    minYear = maxYear - 1,.
    match = dateStr.match(/^(\d{2})-(\d{2})-(\d{4})$/),
    months,
    day,
    year;

    If {(matches)
    month = parseInt (matches [1], 10);
    day = parseInt (matches [2], 10);
    year = parseInt (matches [3], 10);

    If (month < 1="" ||="" month=""> 12) {}
    errorMsg = "invalid value for the month: ' + matches [1];"
    } ElseIf (day = 0) {}
    errorMsg = "invalid value for the day:" + match [2];
    } else if (! checkDaysInMonth (day, month, year)) {}
    errorMsg = "number of days for invalid month: ' + match [2];"
    } ElseIf (year < minyear="" ||="" year=""> maxYear) {}
    errorMsg = "invalid value for the year:" + match [3] + "-must be between" + minYear + "and" + maxYear;
    }
    } else {}
    errorMsg = "invalid date format: ' + dateStr + ' \r\nPlease use format: dd-mm-yyyy ';"
    }

    return errorMsg;
    }

    function checkReceivedDate() {}
    var value = AFMergeChange (event),
    errorMsg = ";
       
    ignore control if the value is blank, because this field is not mandatory
    If (! value) {}
    return;
    }

    If {(event.willCommit)
    errorMsg = checkDateFormat (value);

    If (errorMsg) {}
    App.Alert (errorMsg, 0, 0, "error");
    Event.value = ";

    Returns false;
    }
    } else {}
    Allow only characters that match the regular expression
    Event.RC = /^(?:0) [1-9]? 1 [012]?) ? -? ( ? : 0 [1-9] ? | [12] [0-9]? 3 [01]?) ? - ? 2? 0? [0-9] {0,2} $/ .test (value);
    Event.RC = / ^ \d{0,2}-?\d{0,2}-?\d{0,4}$/.test(value);
    }

    Returns true;
    }

Maybe you are looking for

  • Tip: Faster boot Windows 7 and Vista

    By default, Windows Vista and Windows 7 dΘmarrez with a single processor. If you have a multi-core PC, you can change the number of processors used during system startup. Speed will be improved a bit but don't expect wonders, Do it like this: 1. open

  • Old School game Q

    Hey, my wife wants to play internet backgammon as she used to Win XP, but I can't find anywhere to get a game like that.  I would be very grateful to anyone who can point me in the right direction. Thanks, Matt

  • What version of windows do I need to connect to a camera digital dual-mode?

    currently I have windows 7 Home Edition premium; I recently bought a digital camera for my daughter and am unable to display or edit his photos as when I connect with the USB cable, the device is not recognized. When I studied the USB it says that th

  • Upgrade of Windows 8 Blurry\Fuzzy Pro install dvd screen and a flash drive.

    Upgrade of Windows 8 Blurry\Fuzzy Pro install dvd screen and a flash drive. Each screen is blurred during the installation. Managed to get It is installed. A great until I had to reboot after the installation of windows updates. It starts with the fi

  • Why Creative Cloud said all my applications are the trial?

    I just bought an annual subscription fee, received an e-mail of confirmation of dealer, the value was credited to my card, but app Creative Cloud said all of the apps are on trial.Even some that I started to use as trial yesterday are now expired.I r