Does it work if you do it inside domReady like gtd? I don't remember if that's required by the API (probably not) but it might trigger a race condition anyway.<br><br>On Sunday, 23 March 2014, Sam Parkinson <<a href="mailto:sam.parkinson3@gmail.com">sam.parkinson3@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I think this is an issue with the backend. I changed to using the dictstore in my activity and it works a charm in chrome; it calls my loaded callback. But on sugar it hangs with loading the data.</div>
<div>I have no idea what is wrong, since it works for get things done activity.</div><div><br></div><div>Sam</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 22, 2014 at 6:55 PM, Sam Parkinson <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','sam.parkinson3@gmail.com');" target="_blank">sam.parkinson3@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>I am just calling this form "define(function(require)". You can see the rest of the file here <a href="https://github.com/SAMdroid-apps/sugar-slides/blob/master/js/activity.coffee" target="_blank">https://github.com/SAMdroid-apps/sugar-slides/blob/master/js/activity.coffee</a></div>
<div><br></div><div>Thanks :)</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 22, 2014 at 6:36 PM, Daniel Narvaez <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','dwnarvaez@gmail.com');" target="_blank">dwnarvaez@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Where are you calling this from? You should not need to setup() manually.<div><div><br><br>On Saturday, 22 March 2014, Sam Parkinson <<a href="javascript:_e(%7B%7D,'cvml','sam.parkinson3@gmail.com');" target="_blank">sam.parkinson3@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><p style="margin:1.2em 0px!important">Hi,</p>
<p style="margin:1.2em 0px!important">I’m just wondering, does anyone have any code snippets for saving on web activities?</p>
<p style="margin:1.2em 0px!important">I’m trying to make a web activity and am having some issues. Here is my save+load code: [CoffeeScript]</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;white-space:pre-wrap;overflow:auto;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;padding:0.5em;color:rgb(51,51,51);background-color:rgb(248,248,255);background-repeat:initial initial">activity.setup()
datastoreObject = activity.getDatastoreObject()
onLoaded = (error, metadata, data) ->
alert data
obj = JSON.parse data
console.log obj
container.html obj.html
$('section').each (x, ele) ->
scribe_slide_setup ele
undefined
datastoreObject.loadAsText onLoaded
activity.write = ->
obj =
html: container.html()
jsonData = JSON.stringify obj
datastoreObject.setDataAsText jsonData
datastoreObject.save()
</code></pre><p style="margin:1.2em 0px!important">Neither methods end up getting called. I’m using 0.100.0.</p>
<p style="margin:1.2em 0px!important">Thanks,<br>Sam</p>
</div></div>
</blockquote><br><br></div></div><span><font color="#888888">-- <br>Daniel Narvaez<br><br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</blockquote><br><br>-- <br>Daniel Narvaez<br><br>