Issue in footable while adding dynamic data

后端 未结 3 1878
情书的邮戳
情书的邮戳 2021-02-15 18:13

I need a little help in jQuery Mobile Foo Table. I am adding data dynamically in a table.

HTML:

    
3条回答
  •  心在旅途
    2021-02-15 18:33

    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( ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""); for (var indx = 0; indx < 2; indx++ ) { $("#tblSRNDetails").append( ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""); } $('#tblSRNDetails').footable(); }); $(document).on('pagebeforeshow', '#second', function(){ });

提交回复
热议问题
SRNFailure DateComplaint Report DatePromised DateCustomer NameLog TimeCreate FSRDays OpenSRN Allocated Time SRN Status ESN Number Request TypeService Request Details
NamefailureDatecomplaintReportDatepromisedDatecustNameLog TimeCreate FSRdaysOpenallocatedTimesrn_statusESNNumberrequestTypecustomerComplaint