jquery mobile动态加载reflow table

找方法真的是找了一天啊,但是结果是好的~~~好开心

链接:http://view.jquerymobile.com/1.3.1/dist/demos/examples/tables/reflow-refresh.html

里面的代码:

其实也就里面红色有用

js:

$( document ).on( "pageinit", function() {
    $( document ).one( "click", "#add_and_refresh", function () {
        var newRows = "6Dr. Strangelove Or How I Learned to Stop Worrying and Love the Bomb196492%747The Graduate196791%1228The Wizard of Oz193990%729Singin\" in the Rain195289%8510Inception201084%78";
        $( "table#table-reflow tbody" )
            // Append the new rows to the body
            .append( newRows )
            // Call the refresh method
            .closest( "table#table-reflow" )
            .table( "refresh" )
            // Trigger if the new injected markup contain links or buttons that need to be enhanced
            .trigger( "create" );
        // We disable the button to make clear that in this demo we have only one set of rows to inject
        $( "#add_and_refresh" ).button( "disable" );
    });
});


html:

Rank Movie Title Year Rating Reviews
1 Citizen Kane 1941 100% 74
2 Casablanca 1942 97% 64
3 The Godfather 1972 97% 87
4 Gone with the Wind 1939 96% 87
5 Lawrence of Arabia 1962 94% 87




你可能感兴趣的:(动态加载,jquery,mobile)