Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82145

Datatables and iPad

$
0
0
I have the desktop browser based DataTables (1.9.4) with individual column input and select filtering working. However, when I try and load this page on an iPad it says Loading data from server and never brings anything back. Also, I see my input boxes for filtering, but not my select. I don't see my menu to choose the number of records to view on the page. I am fairly new to jquery and especially the mobile development. Any help would be greatly appreciated!

[code]
<script type="text/javascript" language="javascript" src="../static/_js/jquery-1.7.min.js"></script>
<script type="text/javascript" language="JavaScript" src="assets/scripts/jquery/UI/jquery-ui-1.8.9.custom.min.js"></script>
<script type="text/javascript" language="javascript" src="../static/dataTable/js/jquery.dataTables.js"></script>

<script type="text/javascript" charset="utf-8">
function fnCreateSelect( aData ){
var r='<select><option value=""></option>', i, iLen=aData.length;
for ( i=0 ; i<iLen ; i++ ) {
r += '<option value="'+aData[i]+'">'+aData[i]+'</option>';
}
return r+'</select>';
}

var asInitVals = new Array();
$(document).ready(function() {
var selectList = ["6","7"];
var oTable = $("#displayData").dataTable( {
bProcessing: true,
bJQueryUI: true,
bServerSide: true,
aLengthMenu: [10, 25, 50, 100],
sPaginationType: "full_numbers",
//oLanguage: {"sSearch": "Search all columns:"},
sAjaxSource: "getSubmissionData.cfm",
fnServerData: function ( sSource, aoData, fnCallback ) {
$.getJSON( sSource, aoData, function (json) {
if ( json.sEcho == 1 ){
$("thead th").each( function ( i ) {
for(var x=0; x<selectList.length; x++){
if(i == 6){
this.innerHTML = fnCreateSelect(json.iName.DATA);
$('select', this).change( function () {oTable.fnFilter( $(this).val(), i );} );
}
else if(i == 7){
this.innerHTML = fnCreateSelect(json.iDept.DATA);
$('select', this).change( function () {oTable.fnFilter( $(this).val(), i );} );
}
}
});
}
fnCallback(json);
});
}
} );

$("thead input").keyup( function () {
console.log($(this).children("input").val());
console.log($("thead th").index(this));
oTable.fnFilter( $(this).children("input").val(), $("thead th").index(this) );
} );

$("thead input").each( function (i) {
asInitVals[i] = this.value;}
);
$("thead input").focus( function () {
if ( this.className == "search_init" ){
this.className = "";
this.value = "";
}
} );
$("thead input").blur( function (i) {
if ( this.value == "" ){
this.className = "search_init";
this.value = asInitVals[$("thead input").index(this)];
}
} );
} );
</script>
[\code]

Viewing all articles
Browse latest Browse all 82145

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>