I need a little help in jQuery Mobile Foo Table. I am adding data dynamically in a table.
HTML:
-
Foo table was created as a jQuery plugin, and as such was never intended to work with jQuery Mobile. It is simply just another plugin not working correctly with jQuery mobile. Foo table don't know how to handle jQuery Mobile page switching.
Only way you can make it work is if you dynamically create whole table each time you visit that page. In any other case Foo table will not work because page is already there with enhanced table markup. That is why every jQuery Mobile widget has a function with a refresh property.
Here's a working example: http://jsfiddle.net/Gajotres/PjmEL/
One last thing, if this is not a good solution for you you should switch to jQuery Mobile implementation of dynamic table.
$(document).on('pageshow', '#index', function(){
$("#tblSRNDetails").remove();
$('').attr({'id':'tblSRNDetails','class':'footable'}).appendTo('[data-role="content"]');
$("#tblSRNDetails").append(
""+
"SRN "+
"Failure Date "+
"Complaint Report Date "+
"Promised Date "+
"Customer Name "+
"Log Time "+
"Create FSR "+
"Days Open "+
"SRN Allocated Time "+
" SRN Status "+
" ESN Number "+
" Request Type "+
"Service Request Details "+
" ");
for (var indx = 0; indx < 2; indx++ )
{
$("#tblSRNDetails").append(
""+
"Name "+
"failureDate "+
"complaintReportDate "+
"promisedDate "+
"custName "+
"Log Time "+
"Create FSR "+
"daysOpen "+
"allocatedTime "+
"srn_status "+
"ESNNumber "+
"requestType "+
"customerComplaint "+
" ");
}
$('#tblSRNDetails').footable();
});
$(document).on('pagebeforeshow', '#second', function(){
});
- 热议问题