Adding to subset panelitems from client

3 posts, 1 answers
  1. Mark
    Mark avatar
    36 posts
    Member since:
    Mar 2014

    Posted 24 Jun 2014 Link to this post

    Im having trouble adding a panelItem to a subset of  panelitems in my panelbar.

    If anybody have a solution it would be appreciated.

    my last test  (that didnt) work was ;

     var panelBar = $find("<%= RadPanelBar1.ClientID %>");
     
    var panelItem = new Telerik.Web.UI.RadPanelItem();
                    panelItem.set_text("test");
                    panelItem.set_value("test");

    var parentItem = panelBar.findItemByValue("FOLLOWUP");
                   //alert(parentItem.get_items().get_count());
                
                   parentItem.trackChanges();
                   parentItem.get_items().add(panelItem);
                   parentItem.commitChanges();
                 
                  panelbar.commitChanges();
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 24 Jun 2014 in reply to Mark Link to this post

    Hi Mark,

    Please do the following modification in your JavaScript which works fine at my end.

    JavaScript:
    function addNewItem() {
        var panelBar = $find("<%= RadPanelBar1.ClientID %>");
        var parentItem = panelBar.findItemByValue("FOLLOWUP");
        var panelItem = new Telerik.Web.UI.RadPanelItem();
        panelItem.set_text("test");
        panelItem.set_value("test");
        panelBar.trackChanges();
        parentItem.get_items().add(panelItem);
        panelBar.commitChanges();
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mark
    Mark avatar
    36 posts
    Member since:
    Mar 2014

    Posted 25 Jun 2014 in reply to Princy Link to this post

    Works like a charm .

    thanks Princy!
Back to Top