Panel buttons not styled.
Hi,
I am having trouble with my buttons looking like simple anchors in my side panel. The panel markup is placed before the div 'data-role="header":
business.html
- <div id="infopanel" data-role="panel" data-position="right" data-display="overlay"
- data-theme="a">
- <!-- panel content goes here -->
- <h3 id="panel_heading"></h3>
- <p id="panel_description"></p>
- <div data-role="controlgroup" data-type="horizontal">
- <a href="#" data-role="button">Map</a>
- <a href="#" data-role="button">Coupon</a>
- <a href="#business_list_page" data-role="button" data-rel="close">Close Panel</a>
- </div>
- </div>
I am creating the dynamic html in $(document).on(“pagecreate)... while looping over the list of categories:
business.js
- /* Add event handlers in $(document).on(“pagecreate”)
- */
- $(".ui-listview li a").on("click", function() {
- $("#panel_heading").text($(this).data("Info").title);
- $("#panel_description").text($(this).data("Info").description);
- // Update the panel
- $("#infopanel").trigger("updatelayout");
- $("#infopanel").find("a").button(); // Added this in hopes it would force a refresh on the anchor buttons.
- });
- ....
- // Get all business objects that match the criteria. Occurs in a separate function.
- $.each(getBusinessObjects(businesses, "type", categoryName), function(index, business) {
- $("#" + categoryName + "_list")
- .append("<li><a id='" + categoryName + "_list_anchor" + index + "'" + "href='#infopanel' data- role='button'>" + business.name + "</a></li>")
- // Add pertinent data to the anchor tag
- $("#" + categoryName + "_list_anchor" + index).data("Info", {
- title: business.name,
- description: "Debug test to see if this works!"
- });
- });
I intend to add more data to the individual anchors in the listview to use in the panel.
It basically works fine. When I click on a listview item, the panel opens with the data attached to the anchor that I can use in the panel.
The trouble is the button group is not styled by Jquery but are only simple links.
Thanks in advance for any help.