How to put checkbox in the treeview with javascript

  1. #1

    How to put checkbox in the treeview with javascript

    Hi,

    I am working with the component Drag and Drop - Grid to Tree, carry the data returned from the database and render the treeview dynamically, when I select a row of the grid to move to the Tree that line must be rendered with a checkbox.
    Below is the javascript code that has the component:

    var beforenodedrop = function (e) {
                if (Ext.isArray(e.data.selections)) {
                    e.cancel = false;
                    e.dropNode = [];
                    var rec;
    
                    for (var i = 0; i < e.data.selections.length; i++) {
                        rec = e.data.selections[i];
    
                        e.dropNode.push(this.loader.createNode({
                            text: rec.get("NomeRazao"),
                            leaf: true
                        }));
                    }
    
                    return true;
                }
            }
    If anyone can help thank you.

    I've tried adding several lines of code in javascript that caused them to the line that I sent to the treeview drag and drop to render the checkbox but I can not follow the examples below I have used:

    e.dropNode [0]. childNodes.Checked == true;
    e.dropNode [0]. Checked == true;
    e.Checked == true;

    I tried using this way, because I assumed that the Checked property of the treeview item is indicating that it will have a checkbox or not, and it is immaterial whether the property is True or False, if the property is in the field setada check will appear.
    Last edited by kami; Jul 20, 2011 at 1:15 PM.

Similar Threads

  1. How to disable and enable a checkbox using Javascript
    By phancongphuoc in forum 1.x Help
    Replies: 1
    Last Post: Mar 24, 2010, 8:00 AM
  2. How add Checkbox in TreeView Control
    By Satyanarayana murthy in forum 1.x Help
    Replies: 2
    Last Post: Nov 16, 2009, 11:25 PM
  3. Treeview and XML
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 31, 2008, 3:56 PM
  4. Looking for example of treeview with objectdatasource
    By pkellner in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 24, 2008, 11:13 AM
  5. Viewport and TreeView
    By t0ny in forum 1.x Help
    Replies: 17
    Last Post: Aug 06, 2008, 10:28 AM

Tags for this Thread

Posting Permissions