Skip to content Skip to sidebar Skip to footer

Jquery Mobile - Span Refresh Within Li

dynamic span added to li - lost JQuery-Mobile format of listview. Is their a way to resfresh the span? UPDATED CODE: shows additional code and html section, listview will not refre

Solution 1:

Thanks to Omar the solution was simple, just wrap the span in a li, I had created li elseware and appended it to the ul.

            $(data).find("tr:has(td.Chats)").each(function () {
                var $li = $('#region3'); //.append('<li></li>');
                var $tds = $(this).find('td');
                var txtcolor = $( this ).css( "color" );
                $li.append('<li style="height: 24px;"><span>' + $tds.eq(0).html() + '</span><br>' 
                + '<span style="float: left; width: 20%; height: 24px; background-color:' 
                + $tds.eq(1).css("background-color") + '; color:' + $tds.eq(1).css("color") + ';">' 
                + $tds.eq(1).html() + '</span>' 
                + '<span style="float: left; width: 20%; height: 24px; background-color:' 
                + $tds.eq(2).css("background-color") + '; color:' + $tds.eq(2).css("color") + ';">' 
                + $tds.eq(2).html() + '</span>' 
                + '<span style="float: left; width: 20%; height: 24px; background-color:' 
                + $tds.eq(3).css("background-color") + '; color:' + $tds.eq(3).css("color") + ';">' 
                + $tds.eq(3).html() + '</span>' 
                + '<span style="float: left; width: 20%; height: 24px; background-color:' 
                + $tds.eq(4).css("background-color") + '; color:' + $tds.eq(4).css("color") + ';">' 
                + $tds.eq(4).html() + '</span>' 
                + '<span style="float: left; width: 20%; height: 24px; background-color:' 
                + $tds.eq(5).css("background-color") + '; color:' + $tds.eq(5).css("color") + ';">' 
                + $tds.eq(5).html() + '</span></li>');
            });

            $('#region3').listview('refresh');

Post a Comment for "Jquery Mobile - Span Refresh Within Li"