I got a big Problem and dont know how to fix it.
I get from server a json string. With this i want to insert dynamic a list and popup div's wich is called by listelement-button. It seems i must reload the jquery popup plugin because the data-role tag="popup" is not regard. As a solution after insert the content from popup is showing in my page.
Look at screenshot pls:
Look my Code
- <section id="popup_area">
-
- </section>
-
- <script>
- //Init Historyview
- $.getJSON('../BackEnd/GetHistory.aspx', function (json) {
- $.each(json, function (titel, date) {
- var $li;
- if (date.status == "2") {
- $li = $('<li><a><img class="rotate" src="' + date.beleg + '"><h1>' + date.titel + '</h1><p>' + date.date + '</p></a><a href="#' + titel + '" data-rel="popup" data-icon="alert" data-transition="slide">Details</a></li>');
- }
- else {
- if (date.status == "3")
- $li = $('<li><a><img class="rotate" src="' + date.beleg + '"><h1>' + date.titel + '</h1><p>' + date.date + '</p></a><a href="#' + titel + '" data-rel="popup" data-icon="delete" data-transition="slide">Details</a></li>');
- else
- $li = $('<li><a><img class="rotate" src="' + date.beleg + '"><h1>' + date.titel + '</h1><p>' + date.date + '</p></a><a href="#' + titel + '" data-rel="popup" data-icon="check" data-transition="slide">Details</a></li>');
- }
- $('#historylist').find('ul.dynlist').append($li);
- $('#uList').listview("refresh");
- $pop = $('<div data-role="popup" id="' + titel + '" data-theme="d" data-overlay-theme="b" class="ui-content" style="max-width:340px;"><img class="rotate" src="' + date.beleg + '"></div>');
- $('#popup_area').append($pop.popup());
- });
- });
-
- </script>
But its not working. The list is correctly create and i see my "popups" under my list wich is in my Section "popup_area". If i click on the icon in the list:
- i mean this section -> `<a href="#' + titel + '" data-rel="popup" data-icon="alert" data-transition="slide">Details</a>`
the Display change colour a little bit white (like by popup) but nothing is showing.
So i think after create dynamic section id="popup_area" i must aktivate the popup funktion anyway.
- Like after create dynamic list elements -> `$('#uList').listview("refresh");`
This was neccesery for aktivate the typica![enter image description here][1]l list design of Jquery.
Anybody an idea? Please help