I am working with a webapp that contains jqGrid and prettyPhoto plugins.
First round with selecting a row from the grid which fills specified divs with information works correctly. Pics and animations play as intended.
But if my user would select another size of munitions (clicking on another menu drop-down) which would create a new jqGrid with new data. This is where I am having problems. In my onSelectRow sequences of jqGrid, I check for the presence of children on a certain div. If children are found, I am trying to kill the old 'data' and reinsert the new data. But my operation is killing my link to the prettyPhoto.
I have tried remove() and then appending new sequence to the div, replaceWith() and selecting all the 'li' from the div, and the replace(). But something is interrupting the prettyPhoto interaction upon a second row selection from jqGrid.
What am I doing wrong?? Willing to learn new tricks.
This is line #998 from my attachment:
- if (jQuery('#slideshow').children().length > 0) { // previous build of prettyPhoto sequence has happened.
$('#slideshow').children().remove();
$('<ul class="clearfix"></ul>').append(data.picsequence).appendTo('#slideshow');
} else {
$('<ul class="clearfix tabArea"></ul>').append(data.picsequence).appendTo('#slideshow'); // this would be the first time around -- which always works.
}
My online testing area is
here. Here is the user sequence -- Click on 22 cal menu option under Small Arms. Click a row (ie. A085). Verify that prettyPhoto is working by clicking on Multimedia and then Slideshow. Click the 'thumbnail'. Should result in a nice smooth animation. Now click on the same 22 cal menu option again from Small Arms. Select a different row (ie A086). This time when the user would click on the thumbnail in the Multimedia > Slideshow area, the resulting action just brings up the picture in a new browser window.
jQuery 1.4.4/jQuery-UI 1.8.6
Tony
Sorry to be long winded, but it gets my exact problem across.
It is not the job you get handed, but what you have done with it in the end that people remember.