0

I have a Jquery Mobile app with some reports inside collapsible regions. Those reports have a pagination of three rows per page, and when I press the "Next" link it works fine, showing the next three rows. The only problem is that it reloads the page and the collapsible region returns to the default state (closed).

I want to know if there is any way to save the state of the region and load it after the page has reloaded, so the user don´t have to expand it again. I tried with some JavaScript code I found, but it didn't worked.

I'm using Apex 4.2.0.

Thanks in advance.

EDIT:

After some experiments, I advanced a little. I save the regions IDs with this:

var lOpenRegions = []

$(".ui-collapsible:not(.ui-collapsible-collapsed)").each(function()

  { lOpenRegions.push($(this).attr("id")) });

SetCookie("HideShowOpenRegions",lOpenRegions.join(","));

And I check at the Page Load with this in a DA:

if (GetCookie("HideShowOpenRegions")) {

  $.each( GetCookie("HideShowOpenRegions").split(','),

            function(intIndex, objValue) {

              $("#"+$nvl(objValue,"x")).trigger('expand');

            }

  );

}

That works whenever I move between the app pages, expanding the regions stored in the cookie, but it doesn't work with the pagination. When I press the Next or Previous links, it checks for the cookie and reads the objValue (tested this with an alert(objValue)) but the regions remains closed.

Someone knows why?

Tony Andrews
  • 129,880
  • 21
  • 220
  • 259

1 Answers1

0

I believe that is because the whole page doesn't render... try putting a dynamic action "after refresh" on the region. You can keep track of it a javascript object also.. Bill