hi
when someone edit or add node with drupal site, content page (in android app) can't update yourself
just when node add or edit with mobile app content page will be updated
how can i change content.js to always show new list of nodes(or add refresh button for content page)
sorry for my english ;)

Comments

Anonymous’s picture

any idea?
when i press "back to content" button in 'node.html' page, back to 'content.html' that is cached
it has $("#drupalgap_page_content_list").listview("destroy").listview();
but 'content.html' can't show new content list
how can i force 'content.html' that show new content list every time

Anonymous’s picture

in content.js i add
drupalgap_views_datasource_retrieve.local_storage_remove(views_options);
before
drupalgap_views_datasource_retrieve.resource_call(views_options);
and list show change, every time that 'content.html' is viewed
is it ok?

tyler.frankenstein’s picture

Assigned: Unassigned » tyler.frankenstein
Status: Active » Needs review

You should be able to pass in:

views_options.load_from_local_storage = 0;

And this will force a reload on the data instead of pulling from the cache. I have been thinking of automated ways for this to be accomplished, but for now, the 'load_from_local_storage' option set to 0 would be your best bet. Check out this page to see the options you can pass in:

https://github.com/signalpoint/DrupalGap/blob/master/drupalgap/services/...

Anonymous’s picture

it's perfect!
thank you so much, for your reply and for your great job

Anonymous’s picture

Title: content list update » file delete with rest services
Status: Needs review » Active

.

Anonymous’s picture

.

tyler.frankenstein’s picture

Title: file delete with rest services » content list update
Status: Active » Closed (fixed)
s.daniel’s picture

Status: Closed (fixed) » Needs review

Thanks, for your support and code.
It seems to me views_datasource.js currently doesn't support the setting and requires a small change in order to work:
https://github.com/sDaniel/DrupalGap/commit/f2a09000f1494f55bf10fd2be9d1...

Anonymous’s picture

yes,
I've changed it too

zhongguo999999’s picture

In this section we will explain how to fetch data from remote sources:

1. in \assets\www\drupalgap\pages\content.js

		// Build content retrieve resource call options.
		views_options = {
			"path":"views_datasource/drupalgap_content",
+			"load_from_local_storage":"0",  //"load_from_local_storage":0, is wrong
			"error":function(jqXHR, textStatus, errorThrown) {

2. in \assets\www\drupalgap\services\views_datasource.js,

	"resource_call":function(caller_options){
		try {
			// TODO - Validate views json display path.
			this.resource_result = null;
			this.resource_path = caller_options.path;
+			this.load_from_local_storage = caller_options.load_from_local_storage;
			options = {
				"resource_path":this.resource_path,
				"type":this.resource_type,
+				"load_from_local_storage":this.load_from_local_storage,
				"async":true,
tyler.frankenstein’s picture

Component: Code » Module Code
Status: Needs review » Closed (fixed)

The latest version of the 7.x-1.x-alpha branch of the mobile application development kit has taken care of the bugs mentioned here. If you continue to have problems, please feel free to re-open this issue if it is similar and explain in detail what is happening. Otherwise create a new issue, thanks!