This is a migrated thread and some comments may be shown as answers.

Checking Radtreeview node takes too much time to load.

0 Answers 61 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Aayam
Top achievements
Rank 1
Aayam asked on 11 Nov 2008, 07:13 AM
Hi ,
I am using Rad treeview version 2008.2.723.35.
I am using onload demand using web service with minimum custom class used to return the node data.
My Problem is i have a parent node with around 1500 child brands.
When i check the parent there is a javascript function attached to OnClientNodeChecked event which check the child brands.

function

AfterCheckBrands(sender, eventArgs) {

 

 

    var node = eventArgs.get_node();

 

 

    if (node.get_checkBoxElement().checked == false) {

 

        tempNode = node;

 

        while (tempNode.get_value() != null) {

 

            tempNode = tempNode.get_parent();

 

            //tempNode.uncheck();

 

            tempNode.get_checkBoxElement().checked =

false;

 

        }

    }

    UpdateAllChildren(node.get_nodes(), node.get_checkBoxElement().checked);

}

 

function

UpdateAllChildren(nodes, checked) {

 

 

    var i;

 

 

    for (i = 0; i < nodes.get_count(); i++) {

 

 

        if (checked) {

 

 

            if (nodes.getNode(i).get_checkBoxElement().checked == false) {

 

 

                //nodes.getNode(i).check();

 

                nodes.getNode(i).get_checkBoxElement().checked =

true;

 

            }

        }

 

        else {

 

 

            if (nodes.getNode(i).get_checkBoxElement().checked) {

 

 

                //nodes.getNode(i).uncheck();

 

                nodes.getNode(i).get_checkBoxElement().checked =

false;

 

            }

        }

 

        if (nodes.getNode(i).get_nodes().get_count() > 0) {

 

            UpdateAllChildren(nodes.getNode(i).get_nodes(), checked);

        }

    }

}

When i am just checking the checkBoxElement and not setting the state using check() ot uncheck() for node it works fine.The script does not time out.
But the twist is that the node state is not set.Let say i checked a parent and children nodes  gets check through javascript.But when i try to uncheck the any child brand the checkBoxElement for that node remains checked.I am assuming that when i explicitly trying to uncheck that node for the first time then internally it state get set to checked even if the checkBoxElement is displayed checked.When i try to uncheck it second time it works fine and according to javascript unchecked the parent node also.
So just setting the checkBoxElement of the node it not internally setting it state to checked or unchecked.

But when i try to use radtreeviewnode.check() or uncheck() then  i get an IE error saying the script is taking too much time.
If i abort the scipt my tree comes into intermediate state which is not correct.
Is there any way i can get over any of the above two problems i am facing.
Any help will be greatly appreciated.

Regards,
Aayam Singh

No answers yet. Maybe you can help?

Tags
TreeView
Asked by
Aayam
Top achievements
Rank 1
Share this question
or