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

Div in PanelBar without ajax call

1 Answer 112 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Randall
Top achievements
Rank 1
Randall asked on 25 Feb 2012, 08:34 PM
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.

1 Answer, 1 is accepted

Sort by
0
Randall
Top achievements
Rank 1
answered on 25 Feb 2012, 08:47 PM
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.
Tags
PanelBar
Asked by
Randall
Top achievements
Rank 1
Answers by
Randall
Top achievements
Rank 1
Share this question
or