Skip to main content

Solved - Edit jQuery Mobile nested-list - Event



I'm trying to add a clicked elements into a jquery mobile nested list. I'm having no problem adding the item but I'm having problem changing the text and url on the item (link).





I can see the correct list about 0,5 seconds before it refreshes and everything is the same.





What event can I use to edit a list-item after being listed?





I've tried to run the code from firebug console and everything works , see code below:







var test = $('.ui-page-active .ui-listview > li > div > div a').first().text();

var data = $('body').data('mobilMenu');

var url = $(data).find('a').filter(function() {

return $(this).text() === test;

}).attr('href');





$('.ui-page-active .ui-listview > li > div > div a').first().text(test +" - hovedside");

$('.ui-page-active .ui-listview > li > div > div a').first().attr("href", url);







This solves the problem







$( "[data-role='page']" ).live( 'pagehide',function(event, ui){







. had the wrong selector


Comments

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?