--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
but the idea is to get some of the data as it is being calculated in the controller.
but the idea is to get some of the data as it is being calculated in the controller.
2018-02-13 21:38 GMT+00:00 黄祥 <steve.van...@gmail.com>:
just an idea, perhaps you can use loading animation (javascript, etc) in the view during waiting the long awaited data so that the user dont get bored, after the data is calculated, you can show the data in the view (replace the loading animation).best regards,stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
def long_load(): ret = DIV() ret.append(SCRIPT(_src=URL('static/js','axios.min.js'))) ret.append(SCRIPT( """ function DownLoadTick(e){
document.getElementById("result").innerHTML = e.target.response;
}; function long_load(){
axios({ url: 'streamer', timeout: 1000000, onDownloadProgress: DownLoadTick, withCredentials: true }); }; """ )) ret.append(DIV(_id='result')) ret.append(BUTTON('click me', _onclick = 'long_load()')) return dict(ret=ret)
def streamer(): i=0 while True: # do something for a long time time.sleep(1) yield DIV('part %s' % i).xml() i+=1 if i>5: yield DIV('Done!').xml() break
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
yield DIV(...).xml().encode('utf-8')
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.