Div in PanelBar without ajax call

2 posts, 0 answers
  1. Randall
    Randall avatar
    4 posts
    Member since:
    Apr 2011

    Posted 25 Feb 2012 Link to this post

    I am trying to include a <div> inside a panel (the <li> element) of a PanelBar, but doing so causes an ajax call to be made, even if no contentUrls were provided.  I have even tried injecting the <div> the first time the individual panel is expanded, but if I do that the div does not get hidden when the panel is closed.  If I inject <div class="k-content"> I am back to having the ajax call made when the panel is first expanded.

    My goal of all this is to get a panel with an open arrow icon; when that panel is first opened I want to attach a widget I wrote to the <div> contained in the panel.  The widget works perfectly if I let the panel do an ajax call that returns a simple piece of javascript that attaches the widget to the <div>, but this seems wasteful.

    So, can I put a <div> into a panel of a PanelBar without getting an ajax call?  If not, is there another element I could use that would still cause the panel to work correctly and to which I could attach my widget?  I did try attaching my widget to the <li> element itself, but of course that wiped out the <span> elements that make up the title and hold the arrow icon.
  2. Randall
    Randall avatar
    4 posts
    Member since:
    Apr 2011

    Posted 25 Feb 2012 Link to this post

    OK, I feel stupid.  After wrestling with this for far longer than it deserved, I stumbled over the answer: don't make the <div> empty.  In other words, this causes an ajax call:
    <div></div>
    but this doesn't:
    <div>stuff</div>

    This probably should be mentioned in the documentation; maybe someone else will stumble across this forum thread if they find themselves in a similar position.
  3. Kendo UI is VS 2017 Ready
Back to Top