stakbit/jQuery-Mobile-Listview-Pagination-Plugin — pull request #8 by rovolution (2013-05-08 22:32:56+00:00)
Title: Manual refresh

Hi Jose,

I am continuing to integrate your plugin into my application. As I was going through the integration process, I found the need to be able to manually trigger a refresh of the list. A 'refresh' consists of:

-A call to _invokeAjaxCall()
-When that is completed, a call to _moreBtn() to decided whether or not to show the "Show More" btn.
-Caching the list results in the scoped variable cachedList

When I was examining the codebase, I saw that the above sequence was repeated 3 times within the _create() function, so I thought it might be best to just refactor it into its own method.

I decided to make it a public method because in my application, I am using the plugin in a pop-over panel view. Whenever the popover is opened, I wanted to be able to update the URL that I am making my GET request to in the AJAX callback, and then trigger a list refresh.

I was also pondering caching the DOM reference to the list element (instead of passing it in as an argument to the listDOMRef parameter). Might be a little cleaner.

Check out the updates and let me know what you think! I just added them on to the latest version of the storeAjaxCallbackContext branch code in your repository.

Thanks!
-Rohit K