I want to create a mobile jquery grid consisting of buttons with the onclick or href function. The number of buttons must be created dynamically at runtime. For example, this code block should work as a library index. when you click the library button, it should display the “book names” in the button grid, and when you click the book name buttons, it should display another grid of buttons, which consists of the “chapter numbers” in the book, which will be created dynamically when the book is selected. My static html code to create the mesh,
<div class="ui-grid-d" id="book_chooser"> <div class="ui-block-a"><button class="ui-bar ui-bar-a" style="height:30px">Book A</button></div> <div class="ui-block-b"><button class="ui-bar ui-bar-a" style="height:30px">Book B</button></div> <div class="ui-block-c"><button class="ui-bar ui-bar-a" style="height:30px">Book C</button></div> <div class="ui-block-d"><button class="ui-bar ui-bar-a" style="height:30px">Book D</button></div> <div class="ui-block-e"><button class="ui-bar ui-bar-a" style="height:30px">Book E</button></div> <div class="ui-block-a"><button class="ui-bar ui-bar-a" style="height:30px">Book A</button></div> <div class="ui-block-b"><button class="ui-bar ui-bar-a" style="height:30px">Book B</button></div> <div class="ui-block-c"><button class="ui-bar ui-bar-a" style="height:30px">Book C</button></div> <div class="ui-block-d"><button class="ui-bar ui-bar-a" style="height:30px">Book D</button></div> <div class="ui-block-e"><button class="ui-bar ui-bar-a" style="height:30px">Book E</button></div> <div class="ui-block-a"><button class="ui-bar ui-bar-a" style="height:30px">Book A</button></div> <div class="ui-block-b"><button class="ui-bar ui-bar-a" style="height:30px">Book B</button></div> <div class="ui-block-c"><button class="ui-bar ui-bar-a" style="height:30px">Book C</button></div> <div class="ui-block-d"><button class="ui-bar ui-bar-a" style="height:30px">Book D</button></div> <div class="ui-block-e"><button class="ui-bar ui-bar-a" style="height:30px">Book E</button></div>
This button grid must be created dynamically at runtime depending on the number of books.
I am using jquery, javascript and html5 with the phonegap plugin.
Please, help.
Thanks in advance.
javascript jquery css html5 jquery-mobile
Karthi
source share