Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tejas Shah on Jul 23, 2008 03:24
open dhtmlx forum
DHTMLX Tree : Locking the parent node should lock all children

Hi,
I am not able to lock the item by writing locked="1" in the XML file.
Also I have included the dhtmlxtree_li.js file on the page.

like : <item text="Books" id="books" im0="books_close.gif" im1="tombs.gif" im2="tombs.gif" call="1" locked="1">


Following is the XML file :



<?xml version='1.0' encoding='iso-8859-1'?>
<tree id="0">
    <item text="Books" id="books" im0="books_close.gif" im1="tombs.gif" im2="tombs.gif" call="1" locked="1">
        <item text="Horror" id="horror" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif">
            <item radio="1" checked="1" text="Tejas" id="sk" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"></item>
            <item text="Dan Brown" id="db" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif">
                <item text="Angels & Demons" id="db_1" im0="book_titel.gif" im1="book_titel.gif" im2="book_titel.gif" radio="1" checked="1"/>
                <item text="Deception Point" id="db_2" im0="book_titel.gif" im1="book_titel.gif" im2="book_titel.gif"/>
                <item text="Digital Fortress" id="db_3" im0="book_titel.gif" im1="book_titel.gif" im2="book_titel.gif"/>
                <item text="The Da Vinci Code" id="db_4" im0="book_titel.gif" im1="book_titel.gif" im2="book_titel.gif"/>
                <item text="Deception Point" id="db_5" im0="book_titel.gif" im1="book_titel.gif" im2="book_titel.gif"/>
            </item>
            <item text="Mary Janice Davidson" id="mjd" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif" checked="-1"></item>
            <item text="Katie Macalister" id="km" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif" checked="1"></item>
        </item>
        <item text="Science Fiction & Fantasy" id="fantasy" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif">
            <item text="Audrey Niffenegger" id="af" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"></item>
            <item text="Philip Roth" id="pr" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif" checked=""></item>
        </item>
    </item>
    <item text="Checkboxes" id="checks" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif" open="1" checked="-1">
        <item text="checked= 0" id="check0" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif" checked="0">
        </item>
        <item text="checked=-1" id="checkM1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif" checked="-1">
        </item>
        <item text="checked= 1" id="check1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif" checked="1">
        </item>
    </item>
</tree>
Answer posted by Support on Jul 23, 2008 04:58
>> I am not able to lock the item by writing locked="1" in the XML file.
Please check attached sample, it uses exactly the same XML and lock works for item marked in XML - it become non-operable. ( beware that "locked" doesn't mean non-closable,  or that related checkbox will be disabled - such behaviors controled by separate options )
Attachments (1)
Answer posted by Tejas Shah on Jul 23, 2008 05:54
Hi,
    I think you didnt understand.

  1)  I mean to say that if I add "locked=1" then that item and its child items should not be visible or modifiable.
  
       Please see the attached file;
 
       In this there are two nodes : Manoj Inst and Manoj  Retail and I need to lock first node i.e "Manoj Inst" so user can not change or see its childs.
 
    
  

      

 
Attachments (1)
Answer posted on Jul 23, 2008 07:38
>>should not be visible
Such functionality can't be achieved with item locking.

Please check attached sample, it shows how necessary behavior can be achieved through in-tree events.


Attachments (1)