Error in IE8 with insertItems when inserting lots of items

4 posts, 0 answers
  1. jon *
    jon * avatar
    5 posts
    Member since:
    Sep 2009

    Posted 08 Dec 2009 Link to this post

    Hello,

    I am using RadControls for ASP.NET AJAX v2009.2.1028.35.

    I am having this weird error in IE8 (I tested so far also in Chrome and no error) when using insertItems method:

    Line: 2423
    Error: 'this._element' is null or not an object

    but it happens only when I am inserting lots of items (starting at ~ 4000). Anyway, after this error, the items are properly inserted.

    Can you help me on this please?

    Thank you very much for your products and support!
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 11 Dec 2009 Link to this post

    Hello jon *,

     I have tried inserting 6000 items and there is no error present. Can you provide us with your insert method? 

    I have tried to insert the items the following way:

    function AddItem() {
                var items = [];
                for (var i = 0; i < 6000; i++) {
                    var item = new Telerik.Web.UI.RadListBoxItem();
                    item.set_text(i);
                    items[i] = item;
                }
     
                var listBox = $find("RadListBox1");
                listBox.insertItems(items);
            }

    Does this code produces error on your side?

    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. jon *
    jon * avatar
    5 posts
    Member since:
    Sep 2009

    Posted 11 Dec 2009 Link to this post

    Hello, thank you for your answer.

    Your code is working without errors on my side.

    Here is my code - basically I am adding tree nodes into a list box:
     function addUserNodes(nodesList) { 
                var childNode; 
                var itemForDst; 
                var itemCollection = []; 
                for (var i = 0; i < nodesList.get_count(); i++) { 
                    itemForDst = new Telerik.Web.UI.RadListBoxItem(); 
                    childNode = nodesList.getNode(i); 
                    itemForDst.set_value(childNode.get_value()); 
                    itemForDst.set_text(childNode.get_text()); 
                    itemCollection[i] = itemForDst; 
                } 
                lbxDst.insertItems(itemCollection); 
            } 

    I did some tests:
    - All these tree nodes render fine in the treeview without error.
    - My function does not produce errors if I use another text for the RadListBoxItem (eg: itemForDst.set_text(i); ).
    - Also, all my childNode.get_text() return a non-null and non-empty string.

    So I think there is a problem with my text I try to set, although I apply HttpUtility.HtmlEncode on these strings before passing them client side.

    Any suggestions?

    Thank you in advance guys.
  4. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 16 Dec 2009 Link to this post

    Hi jon *,

    Can you send us the strings that you use along with the code that you use to encode them. It would be best if you have a running sample reproducing the problem. Up to now we haven't heard of similar problem regarding the listbox, therefore we need some additional information in order to research the problem.


    Best wishes,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top