I have been working in Jquery mobile and have been trying some samples and I have been stuck now.
I have a db which stores some data and i have been retrieving through php and printing the data like this:
$("li").click(function(){$("#content").load('get_items.php?div='+index);
});
I am passing a variable index to the db to retrieve details from db from a php script like this:
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("somedbname") or die(mysql_error());
$category_id=$_GET['div'];
$data=mysql_query("SELECT * FROM items WHERE category_id=".$category_id) or die(mysql_error());
$output[] = '<ul data-role="listview" data-split-icon="plus">';
while($row = mysql_fetch_array($data))
{
$output[] = '<li>';
$output[] = '<a href="">'.$row['item_name'].': Rs.'.$row['price'].'/-</a>';
$output[] = '<a href="order.php?action=add&id='.$row['id'].'">do something</a>';
$output[] = '</li>';
}
$output[] = '</ul>';
echo join('',$output);
I wanted to to display the items in a split button list in the page,
but the code is showing a simple un-ordered list with bullets.
I tried with the jquery apis .css() and .addClass() methods but could not get it working.
can any body tell me what could be the solution to get the split button list?
thank you
I think you should trigger the create event. Something like this:
check this out: http://jquerymobiledictionary.pl/faq.html