I am using the data Table library to show a table with pagination and scroll bar enabled in my android device. The scrolling works fine when tested on desktop web browser. But if I test it on my android device (using phonegap and jquery mobile) the scrolling doesn't work. Below is the code. Any pointers is highly appreciable.
<code>
<head>
<script type="text/javascript" charset="utf-8"
src="lib/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="lib/js/jquery.mobile-1.0.1.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.dataTables.css" />
</head>
<body>
<div data-role="page" id="TaskListPage">
<script type="text/javascript">
var otable;
function decorateTable(){
otable = $('#demo').dataTable( {
//$("#demo tbody tr").click( function (e) {
// var rowData = otable.fnGetData( this );
// alert( 'The row\'s first cell clicked on had the value of '+rowData[0] );
// } );
I think jQuery Mobile implements its own scrollbars (not 100% certain, but I seem to remember that...) - which might be part of the issue. If you load a normal DataTables scrolling example ( http://datatables.net/release-datatables/examples/basic_init/scroll_y.html ) on your Android device does it work okay?
I'm using jquery mobile 1.2 and DataTables 1.9.4 with PhoneGap and scrolling tables work well - up to a point - on both android 4.2 and ios5 - I'm getting tables which fit the screen properly and scroll nicely . But I'm trying to use an event on clicking one of the rows - this works fine with the same code on a desktop browser, but has different results on Android and iOS:
on Android the click event is actioned but the new window doesn't get given the variable from the opener window (this is probably not a DataTable issue though); in ios the click event doesn't action at all.
My code is below (I'm a jscript newbie so please forgive any bad usage!)
$('#example tbody tr').live('click', function () {
var sTitle;
var nTds = $('td', this);
var sNumber = $(nTds[0]).text();
var sName = $(nTds[1]).text();