Add select menu to Controlgroup Dynamically
Description
The following code shows how to add select menu to Controlgroup Dynamically.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type="text/javascript"
src="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.js"></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.css">
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){<!-- www. j a va2 s . co m-->
$("button").click(function show_filters() {
$("#Button_show_filters").after('<select id="sm"><option>Opt 1</option><option>Opt 2</option></select>');
$("#sm").selectmenu();
//$("#test").controlgroup("option", "corners", true);
$("#test").controlgroup();
});
});//]]>
</script>
</head>
<body>
<button onclick="show_filters()">Push me!!!</button>
<div id="div_for_harakteromenklatury_list_ff">
<br />
<fieldset data-role="controlgroup" data-type="horizontal" id="test">
<a id="Button_show_filters" data-role="button" href="#page1"
onclick="return false" rel="external">Butt 1</a>
</fieldset>
</div>
</body>
</html>