google-code-export / dynatree

Automatically exported from code.google.com/p/dynatree
1 stars 0 forks source link

I am unable to use dynatree in js files, works fine in php files #494

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
var jsoncat =  jsoncat.replace(/\%/g,'"').trim();
        var jsoncat =  '{"data":['+JSON.stringify(jsoncat)+']}';
        var jsonObj =  JSON.parse(jsoncat);
        cWindowShow('jax.call("community","admin,groups,ajaxEditGroup", ' + groupId + ');', 'Editing Group' , 550 , 450);
        var delay=1000;//1 seconds
        alert(typeof(jsonObj));
        alert(jsonObj.data);    
        setTimeout(function(){
            var treeData = [jsonObj.data];
                // --- Initialize sample trees
                jQuery('#tree1').dynatree({
                    checkbox: true,
                    // Override class name for checkbox icon:
                    classNames: {checkbox: "dynatree-radio"},
                    selectMode: 3,
                    children: treeData,
                    onActivate: function(node) {
                        jQuery('#echoActive1').text(node.data.key);
                    },
                    onSelect: function(select, node) {
                        // Display list of selected nodes
                        jQuery("#categoryid").val(node.data.key);
                    },
                    onDblClick: function(node, event) {
                        node.toggleSelect();
                    },
                    onKeydown: function(node, event) {
                        if( event.which == 32 ) {
                            node.toggleSelect();
                            return false;
                        }
                    },

                }); 
            },delay);

this is my code.
Thank You!

Original issue reported on code.google.com by khurram....@gmail.com on 23 Jan 2015 at 3:23

GoogleCodeExporter commented 9 years ago
This is not enough information to reproduce or analyze a problem, sorry.
Please give details, add a stack trace or set up a jsFiddle,
thanks

Original comment by moo...@wwwendt.de on 12 Feb 2015 at 7:18