Tree with hierarchical function to check/uncheck the checkbox

Hello

I build a tree with checkbox APEX 3.2 feature

My query tree looks like
Select "SERVICE_ID' id
"PARENT_ID" pid
, The name of 'service_name '.
connection null
APEX_ITEM. CheckBox(1,SERVICE_ID) a1
null a2
of ' #OWNER # '. " SERVICES_TEST ".
Start with "SERVICE_ID" =: P9_TREE_ROOT
connect prior "SERVICE_ID" = "PARENT_ID".

So far so good. The tree displays correctly

Now my requirement is check_all_child/uncheck_all_child when the parent is checked/unchecked.

Let's take an example like

ROOT
-SERVICE1
-SERVICE1_CHILD1
-SERVICE1_CHILD2
-SERVICE2
-SERVICE2_CHILD1
-SERVICE3

If SERVICE1 is checked, then SERVICE1_CHILD1 and SERVICE1_CHILD2 must be verified.

Could someone help me please on how to do it?
I can write a function onchange against the box, but I need to check/uncheck hierarchically and the hierarchy is dynamic.

Please let me know if any other information is required.

Amri,
Try the following

$('[name=f01]').click( function() {
  this_checked = this.checked;
  this_row = $(this).parents('tr:first');
  this_level = this_row.children('td').size();
  next_row = this_row.next();
  /* Loop through next rows and use the no: of columns to identify children */
  while ( next_row && ( next_row.children('td').size() > this_level) )
  {
   next_row.find('[name=f01]').attr('checked', this_checked );
   next_row = next_row.next();
  }
})

I tested it only on the code of html Tree you posted earlier

Tags: Database

Similar Questions

  • Check whether the checkbox in a form is activated or not using javascript

    When you click a checkbox (TBD) it must set the value of a field with a default value "1234". If uncheck us the box, it must set the field to null.
    I set the box as STATIC2:; 1234 in the form.

    I used the event onClick on the box and calls a function to update the column.
    Inside the function I check if the box is checked using
    If (document.getElementById('P4_TBD').checked = true)
    {
    document.getElementById('P4_COL1).value = '1234';
    }
    on the other
    {
    document.getElementById('P4_COL1).value = "; / * or $s ("P4_COL1", "");

    }

    It works only when the box is checked. If the checkbox is unchecked is not setting the field to null.
    I checked document.getElementById('P4_TBD').checked = false instead of the else clause. It does not work.
    Please help me on this issue.

    Thank you
    Ravi

    When you use the check box or option button, your button ID is using an index. If you create a group of 3 check with ID = "MY_CHECKBOXES" boxes, APEX will create the following ID for each of your options: MY_CHECKBOXES_0, MY_CHECKBOXES_1 and MY_CHECKBOXES_2. If you want to test if the first checkboxe is checked, you will use document.getElementById('MY_CHECKBOXES_0').checked.

    I didn't test a single checkbox, but I would expect your check to be "TDB_0" not "BDM" which is the frame that surrounds your checkbox group.

  • How do I uncheck the checkbox

    Hi all
    It is perhaps too easy, but I tried this for a long time. I have two areas in my form, delivery address and billing address. In the area of billing address, I have a checkbox that makes copying data from address fields expedition to billing address fields if it is checked. It works very well in my application. But what I want to do now is, if the user change the billing address or shipping address after you copy the data, I want to uncheck the checkbox. For some reason I'm not able to get this working. I tried to use following code to achieve this.

    document.getElementById('P30_SAME_AS_SHIPPING').value = 'no '; -that the LOV box has Yes for archiving. also tried with "

    document.getElementById('P30_SAME_AS_SHIPPING').checked = false; -I tried with FALSE, False, too much unchecked

    I would be grateful if someone could guide me to solve this problem. Thank you
    SOE

    Hello

    Have you checked that the ID for the checkbox control is in fact "P30_SAME_AS_SHIPPING"? As a page box element can have multiple values and, therefore, check the page several boxes, they will each receive a unique ID by adding a sequential number after the name of the element. Make a display on the page Source to verify.

    Andy

  • Insert selected in several checked uncheck the delete record

    Hi all

    I have a detailed block I add a checkbox not database once check the records is inserted into the temporary table

    the same records uncheck the box delete records

    IAM has inserted when checking the records of the table

    but when I have a check only check all records are deleted in my temporary table

    WHEN-BOX-CHANGE

    declare

    v_app_user_id integer (10);

    number of v_count;

    Start

    v_app_user_id: = dtc_util.get_global_value('dtc_global.user_id');

    go_block ('RULE_ITEM');

    premier_enregistrement;

    loop

    SELECT count (1) in the dtc_rule_item_lock v_count

    where rule_item_id =: rule_item.rule_item_id;

    If Checkbox_Checked ('rule_item.checkout') and v_count = 0 then

    insert into dtc_rule_item_lock values (:rule_item.rule_item_id, v_app_user_id, sysdate);

    ELSIF: RULE_ITEM. BOX = 'n' then

    DELETE FROM dtc_rule_item_lock

    where exists (select 'x' from dtc_rule_item dtcl

    where dtcl.rule_item_id =: rule_item.rule_item_id);

    end if;

    When the output: system.last_record = "TRUE";

    next_record;

    end loop;

    premier_enregistrement;

    If form_success or sqlcode = 0 then

    message ("documents saved successfully in the database '");

    message (' ', no_acknowledge);

    FORMS_DDL ('COMMIT');

    on the other

    message ("error saving documents: ' |") SQLERRM);

    message (' ', no_acknowledge);

    end if;

    end;

    Let me help you for this

    Thank you

    Olivier

    I guess there is the clause does not. You check against dtc_rule_item, I guess that is dtc_rule_item_lock.

  • A field using text to check/uncheck the check box

    Hello

    I have a series of boxes in my form. I tried to get it then one of the automatically active boxes / turns off if the text is entered or completely removed from a text field.

    I can get to "verify" when the text is entered, but nothing I've tried is "uncheck" when the text is deleted and the field is empty.

    The most logical script I've tried seems to be this...

    In the event of changing a text field (checkbox (called 'other') both the text field are wrapped in the subform even):

    If

    ((this.rawValue! = "") |) (this.raw.Value! = "null")) {

    other.rawValue = "1";

    }

    else {}

    other.rawValue = '0 '.

    }

    This verification when a character of text entered in the field, but not clear when they are deleted. I tried to reverse so the 'if' was rawValue '0' (using == instead of! =) around two ways in the case of 'exit' - and the other was rawValue '1' - new 'check' but not 'uncheck the box. I tried all combinations of if / if and if/else I can think of.

    I know I must be missing something obvious, but anyone could explain why it does not work, and how I can the script to make it work?

    Thank you!

    TW

    Try this on the change of the textfield event.

    var txtLength = xfa.event.newText.length;

    If (txtLength > 0) {}

    CheckBox1.rawValue = "1";

    }

    else {}

    CheckBox1.rawValue = '0 '.

    }

    I hope this helps.

    -Rambeau.

  • Function to check for the existence of the table

    Hi all

    Is there a direct function that can let me know whether or not a particular Table exists in Oracle DB.

    TIA

    See you soon,.
    Parag

    There is no function to check, but we can write our own logic to check if it exists or not.

    CREATE OR REPLACE FUNCTION CHK_TABLE(P_TABLE_NAME IN VARCHAR2) RETURN VARCHAR2 AS
    M_EXISTS VARCHAR2 (1);
    NUMBER OF M_CNT;
    BEGIN
    SELECT COUNT (1) IN M_CNT
    FROM USER_TABLES HAS
    WHERE A.TABLE_NAME = UPPER (P_TABLE_NAME);
    IF NVL(M_CNT,0) = 0 THEN
    M_EXISTS: = 'N';
    ON THE OTHER
    M_EXISTS: = 'Y ';
    END IF;
    RETURN NVL(M_EXISTS,'N');
    END CHK_TABLE;
    /

    Satyam.

  • function which checks if the input text is the same as the text in the Flash file

    Hello!

    I'm doing a Flash AS2 project for learning the word and I would like to know your opinions and your advice on this topic:

    I have Word check the task, where you have to write (text input) the correct names under these 3 photos and check if you wrote them properly with the key - "CHECK!"

    It would be simple, but it is mandatory that the text of the inscription must be compared to a text file and then checked if they match.

    I added a picture to better understand...

    Picture1.png

    Is this possible in AS2?

    Thank you!

    you don't know.

    Use the text property of the textfield object and load the text file using loadvars.  you will have to parse text loaded using the string of flash (and perhaps array) methods.

    p.s. that apple looks more like a tomato for me.

  • Is it possible to toggle different parts of a dynamic form by checking / unchecking a checkbox?

    I creates a form that has several sections with only a few sections of relevant to any particular customer. Essentially, I want to disable-disable/make invisible, the other sections that are not relevant for the customer based on the boxes that they check. Therefore the printed form displays only the relevant sections to the customer. I am very new to Adobe Designer any help with this would be appreciated. Thank you.

    Hello

    (1) add the check box for each section.

    (2) set the value WE, as the value of Y and OFF as N for each checkbox

    (3) add the script to the achievement of the following:

    If (chkbox.rawValue == "Y")

    {

    section. Presence = "visible";

    }

    on the other

    {

    section. Presence = "hidden";

    }

    If you wish, you can send me the form @ [email protected]

    Thank you

    VJ

  • Uncheck the checkboxes.

    I have to fill a form that was sent to me. I can type in the blanks very well. When I click on a checkbox, it highlights, but there is no verification, x, point or something. If I print the form, I get a small image of a pair of scissors where the check mark should be. It has been suggested that I have install fonts Zapf Dingbats and AdobePiStd what I did. No difference. I called the manufacturer form, and they say it works very well. I use Adobe Acrobat X pro. I also opened the form by the author in IE8 and tried there. No difference. I use Win XP Pro. Can anyone help?

    Thank you. I can respect that it is not a problem with the file. Regarding installation Zapf Dingbats or AdobePiStd, which is not needed and cause problems in older versions of Acrobat with checkboxes. Try to remove Zapf Dingbats and see if that makes a difference. If it's not her, I would consider doing a repair of Acrobat.

  • Firefox keeps asking if I want to record the same passwords if I continue to unchecking the checkbox of password to remember

    I use the latest version

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions of the origin of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • How to add and delete a hidden gross a table while checking and unchecking the box?

    I want to add an array of 1 * 1 or saw just a cell with the text field, when I check the box and remove the same when I uncheck the checkbox. I have tried almost everything, but doesn't show is not the correct result. Can someone Guide please?

    Hello shahnisarg28,

    I think you can get what you want by simply using the Action Builder provided by the program.

    Make you it visible to the cell when the checkbox is enabled by:

    1. you right-click the checkbox, select Actions - Add Action.

    2. you set

    Condition: When the check box is selected

    Result: (show or hide an object) = the visibility of visible cell salt

    You do the hidden or invisible cell when the checkbox is unchecked by:

    1. you right-click the checkbox, select Actions - Add Action.

    2. you set

    Condition: When the checkbox is unchecked

    Result: (show or hide an object) = set the cell visibility to hidden.

    Tell me if that works for you.

    Kind regards

    David.

  • Fill the tree with complex external XML file control

    Hi all. I've been combing through forums for two days and have not been able to find a solution to my problem. I'm trying to populate a control of the tree with an external xml file, but the xml file is not a simple. It is complex, and I don't know how to get the tree to display these data. I have attached the code. Can someone take a look and let me know how I could get this to work? Thank you!

    What does not work?

    Complexity of the XML is not, in itself, an issue for the tree.

    Also, I recommend using straight XML, unless specifically, you need Collection features.

    Tracy

  • In the tab "Regional and Language Options", "Language support additional" Section__Install files for complex scripts is greyed out, cannot uncheck the box

    Hello, I have two problems with the language bar Options:

    1. I can't uncheck the checkbox "Install files for complex scripts and right-to-left languages" because the box is checked and grayed out. Could someone please suggest how to disable and uninstall the files?

    2. when I run Windows icon does not automatically appear in the taskbar until the language bar I click anywhere on the desktop (who does appear instantly). Someone has any idea how to solve the problem?

    Thanks in advance for your help

    Hello

    I experienced a few problems here which was virtually anonymous to your problem, I wasn't able to check it out instead of clear.
    Clear the check box, you must insert the CD of installation for the i386 file and then process. It could be solved.
  • Uncheck the box "Always remember this answer" see Box

    Hi guys,.

    is it possible to uncheck the checkbox "Always remember this answer" to the crash-Popup?

    I would like to insert a source element that has only one IN an area of my sequence IN/OUT-marked.

    Nothing special, but I chose the right method to the popup to overwrite a now, it does not account for the IN/OUT in the sequence a places IN/OUT all area of the source element.

    So, is there any way I can cancel it?

    Thank you very much.

    Matt.

    Hi Bildecht,

    You can try to denigrate the first pro preferences and check.

    For windows, go to start > search and in search type %appdata%\microsoft\windows\sendto which opens a folder of the mobile. In which access adobe > Premiere Pro and rename the folder 7.0 or 6.0 old7.0 or old6.0 (for cs6 is 6.0 and for CC it's 7.0).

    For mac: click on go to mac menu and choose go to folder option. Go to the Inbox type ~/library folder and click OK. Then navigate to Preferences > adobe > first pro and rename 7.0 or 6.0 file old7.0 or old6.0

    Kind regards

    Vinay

  • two buttons with single function

    I want to create two buttons for single function and a single button for a function. For example, I click on button1, the display shows "clicked1".

    If I clicked on button2, the display shows "clicked2". If I click on button1, and then click button2, it will show that "the two buttons are clicked. However, it does not work in two buttons with single function. What is the problem? Here's the code.

    import flash.display.MovieClip;

    import flash.events.MouseEvent;

    var button1:MovieClip = new Button1();

    Button1.x = 200;

    Button1.y = 200;

    addChild (button1);

    var button2:MovieClip = new Button2();

    Button2.x = 300;

    Button2.y = 250;

    addChild (button2);

    Button1.addEventListener (MouseEvent.CLICK, onClick);

    Button2.addEventListener (MouseEvent.CLICK, onClick2);

    var isClicked:Boolean;

    var isClicked1:Boolean;

    function onClick(evt:MouseEvent):void {}

    isClicked = true;

    trace ("clicked1");

    }

    function onClick2(evt:MouseEvent):void {}

    isClicked1 = true;

    trace ("clicked2");

    }

    If (isClicked & & isClicked1) {}

    trace ("two buttons are clicked");

    }

    Copy the following code

    If (isClicked & isClicked1) {}

    trace ("two buttons are clicked");

    }

    should run WHEN you click on your buttons.  That is to say, place it in a function and call that function when you click on your buttons and after that your Boolean values are updated.  (probably then want to reset these Boolean values in the called function).

Maybe you are looking for

  • Recover cache or server: what is logical to Firefox

    I clicked on a hypertext link to visit a web site that I had not visited for a few months. Firefox showed me the page as it was on my last visit there.I pressed F5 and the page was updated to the latest version.I don't seem to have this problem with

  • Satellite A300-20 a - driver webcam open fail

    I try to try to solve my problem Error: failed to open driver webcam http://img442.imageshack.us/img442/5706/hsd36352.jpg

  • Need to change the location of the "~/.mozilla' for Linux Firefox

    Currently, FireFox seems to all profiles, extensions, etc. under my «~/.mozilla» directory My corporate working directory is mounted on a very remote server network and our routers are unable to deal with the traffic. So I need a way to completely mo

  • My cd rom is not working, tried the fix and still does not not any suggestions?

    They open and close but sounds like the discs just spin, will not read or write. First one did not, then the other follow-up, need help please. I have a dell 2600 I know its old, but for what I need for it's ok, lol

  • 0x800B0100 SP1 error code.

    Recently, I try to install the new Explorer 9 but then Explorer 9 required to install SP1 and then SP2.   Windows Vista SP1 but keep receiving "0x800B0100 error code.  I have install the update of the analysis tool.  Without success.  The updates fou