Dynamically update button labels in a controlgroup
I am trying to dynamically update the labels of two buttons in a controlgroup. The way I am doing it is updating the labels, but the controlgroup is not formed, rather two buttons appear separately side-by-side. Can anyone point me how this can be achieved?
Here is the relevant code:
- // Set the button texts.
- $("#day-slot").empty();
- var markUp = "<a href='#' data-role='button' data-theme='e' onclick='popMenu(true)'>" + days[1] + "</a>" +
- "<a href='#' data-role='button' data-theme='e' onclick='popMenu(false)'>" + slots[2] + "</a>";
- $("#day-slot").append(markUp).trigger("create");
Here is the code in action: http://jsbin.com/abofaq/2
Thanks for any pointers.