@andrew, yes without any problem. And btw, this is a common problem with all plugins..it might be a bug (?).
@Laytonsdad, the code its almost the same I posted in the beginning of topic, but with php code (that I've post as well). I've just created that zip so people won't need to copy paste the code, they just need to extract to the xampp/wamp folder. Also it has already the .js files (plus the plugin .js) and css files.
But the code is this (HTML):
<html>
<head>
<link rel="stylesheet" href="css/jquery.mobile-1.3.2.css" />
<link type="text/css" rel="stylesheet" href="js/raty/doc/css/stylesheet.css"/>
<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/jquery.mobile-1.3.2.min.js"></script>
<script type="text/javascript" src="js/raty/jquery.raty.js"></script>
</head>
<body>
<div data-role="page" id="main">
<div data-role="content" id="content">
<ul data-role="listview" id="listviewA" data-inset="true" data-mini="true" style="margin-top: 0px">
<li style='height: 55px'>
<h2 style='margin-top: 0px; padding-top: 0px'>DEFAULT</h2>
<p class='ui-li-aside'><strong style='font-size: 17px; color: #CC4E4B'>DEFAULT</strong>
<br/>
<div id="score" style="float: right; margin-top: 0px"></div>
</p>
</li>
</ul>
</div>
</div>
<script type="text/javascript">
$(function(){
var info = "";
$.getJSON('info.php', function(data){
$.each(data, function(index, item){
info += "<li style='height: 55px'><h2 style='margin-top: 0px; padding-top: 0px'>" + item.id + "</h2>"+
"<p class='ui-li-aside'><strong style='font-size: 17px; color: #CC4E4B'>" + item.product + "</strong>"+
"<br/><div id='score' style='float: right; margin-top: 0px'></div></p></li>";
});
$("#listviewA").append(info);
$("#listviewA").trigger("change");
$("#listviewA").listview("refresh");
});
});
$('#score').raty({
score: function() {
return $(this).attr('data-rating');
}
});
</script>
</body>
PHP:
<?php
$arr = array();
for($i = 0; $i <= 3; $i++){
$arr[] = array("id" => $i, "product" => "test");
}
echo json_encode($arr);
?>
Edit: To make it clear, I also tried to put this code:
$('#score').raty({
score: function() {
return $(this).attr('data-rating');
}
});
In many different places than its in this code, such as inside the $(function(), below the listviewA.refresh(), etc, without any results.
This post has been edited by Keylogger: 18 December 2013 - 02:19 AM

New Topic/Question
Reply




MultiQuote

|