Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual refresh #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

rovolution
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant