Re: [web2py] Re: controller not returning java script variable correctly

2014-01-15 Thread Jonas Fredriksson
nice solution and it works. thanks On Wed, Jan 15, 2014 at 7:34 PM, Anthony wrote: > graph1 is the actual function, the write function was just for testing. >> This works but it means that I have to make a python function for every js >> function call when passing values from python functions.

Re: [web2py] Re: controller not returning java script variable correctly

2014-01-15 Thread Jonas Fredriksson
ok, now I undestand what you mean: def test(): print "called2" data3=[3, 6, 2, 7, 5, 2, 0, 3, 8, 9, 2, 5, 9, 3, 6, 3, 6, 2, 7, 5, 2, 1, 3, 8, 9, 2, 5, 9, 2, 7] return 'graph1(%s);' % data3 ajax('{{=URL('test')}}',[],':eval'); graph1 is the actual function, the write function w

Re: [web2py] calling custom javascript functions

2014-01-12 Thread Jonas Fredriksson
yes, and it works. thanks On Sun, Jan 12, 2014 at 3:08 PM, Anthony wrote: > Did you try: > > $(document).ready(function() { > myfunction(); > }); > > Anthony > > On Sunday, January 12, 2014 3:48:48 AM UTC-5, jonas wrote: > >> I just wanted to see if it's possible to call custom made js functi

Re: [web2py] calling custom javascript functions

2014-01-12 Thread Jonas Fredriksson
I just wanted to see if it's possible to call custom made js functions using jQuery. I found that it is possible to call by using this function: $(document).ready(function() { $(function_call()); } css tags can also be added. but it is simpler to just use myfunction(); In the web2py book al

Re: [web2py] Re: links in texts stoded in a database

2013-12-30 Thread Jonas Fredriksson
the XML function solved the problem: {{for i, row in enumerate(rows):}} {{=DIV(XML(T(row.table_field), sanitize = True) ) }} {{pass}} thanks. On Mon, Dec 30, 2013 at 3:29 AM, 黄祥 wrote: > another way around is define it on the represent for your table text field. > e.g. > table.table_field.re

Re: [web2py] Re: links in texts stoded in a database

2013-12-29 Thread Jonas Fredriksson
just to clarify, my problem is that html tags in my input text area is just rendered as tags, naturally because the field is classified as text and nothing else. I need to render the html elements when displaying text. On Fri, Dec 27, 2013 at 10:01 PM, Jonas Fredriksson wrote: > I tr

Re: [web2py] Re: links in texts stoded in a database

2013-12-27 Thread Jonas Fredriksson
I tried ckeditor and I've got an editor in admin so I can insert links, so far so good. but the text is still rendered plain with html tags visible. my function and db in db.py: (text field is the field I want to insert links into) def advanced_editor(field,text): return TEXTAREA(_id = str(te

Re: [web2py] Re: anyone tried jQuery svg?

2013-01-08 Thread Jonas Fredriksson
Thanks for the replies. d3js looks very interesting, I will look into that. On Tue, Jan 8, 2013 at 3:56 AM, Andrew W wrote: > I haven't either, but I'd recommend a look at d3js.org, if you want to use > svg. > > I've done something similar to this one, using a web2py generated json data > feed -

Re: [web2py] Re: controller not returning variables

2012-12-24 Thread Jonas Fredriksson
ok, to include everything in the for loop is more elegant. The reason why I wanted to separate the call to sidebar.py is that the sidebar contains almost static material that doesn't change that much, while the main page (index page) has content that changes more. In the first version I had the db

Re: [web2py] Re: custom form validation doesn't work

2012-12-16 Thread Jonas Fredriksson
I send the app to your gmail address. On Sun, Dec 16, 2012 at 4:35 PM, Massimo Di Pierro wrote: > This should work. I do not see why it does not work. Can you email me, > perhaps privately, an example app so I can reproduce it? > > > On Sunday, 16 December 2012 09:26:54 UTC-6, jonas wrote: >> >>

Re: [web2py] Re: custom form validation doesn't work

2012-12-16 Thread Jonas Fredriksson
here is the custom form: {{=form.custom.begin}} date: {{=form.custom.widget.created_on}} name: {{=form.custom.widget.created_by}} mail: {{=form.custom.widget.mail}} link: {{=form.custom.widget.link}} comment:{{=form.custom.widget.comment}} {{=form.custom.sub

Re: [web2py] Re: custom form validation

2012-12-15 Thread Jonas Fredriksson
ok. another thing is that if I use a regular form, {{=form}}, then validation works but not if I use the custom form. Also form.process() works, so the problem seems to be related to custom forms. On Sat, Dec 15, 2012 at 4:06 AM, Anthony wrote: >> form=crud.create(db.comments) >> if form.

Re: [web2py] Re: calling LOAD from a button

2012-12-14 Thread Jonas Fredriksson
thanks I use the following solution; {{for result in res:}} {{=result.id}} {{=result.title}} {{=A(TAG.i(_class="icon-plus-sign"), _rel="tooltip", _title="testing", _class="btn", _href='#', _onclick="jQuery('#uc').toggle();")}} {{=LOAD('default','comment.load',args=result.id,ajax=True)}} with

Re: [web2py] Re: callback question

2012-12-08 Thread Jonas Fredriksson
Thanks, that solved the callback problem. now I just have to figure how to update part of the index.html view. On Sat, Dec 8, 2012 at 4:25 PM, Niphlod wrote: > use the power, Luke! > you have something like this > A(TAG.i(_class="icon-thumbs-up"), _rel="tooltip", _title="you like this", > _class=

Re: [web2py] Re: controller that don't returns a view?

2012-12-07 Thread Jonas Fredriksson
Thanks. Actually the call comes from a button: It has to provide the right result.id so the like addition relates to the right post. I will try using callbacks from the button call to see if it works. On Thu, Dec 6, 2012 at 11:17 PM, Niphlod wrote: > Learned something also today! Nice one Anth

Re: [web2py] Re: images not displayed when using img and URL

2012-12-05 Thread Jonas Fredriksson
no I didn't have it. added this: def download(): return response.download(request, db) and now it works. thanks On Wed, Dec 5, 2012 at 6:56 PM, Niphlod wrote: > do you have a def download(): in controllers/default.py ? > That one is the main handler for using URL('default', 'download',

Re: [web2py] Re: forms redirect and verification doesn't work

2012-12-05 Thread Jonas Fredriksson
now it works, had to put everything in the right order: crud.settings.create_next = URL('index') post=db(db.blog.id==request.args(0)).select().first() db.comments.post_id.default=post.id form=crud.create(db.comments) Thanks again On Wed, Dec 5, 2012 at 12:55 PM, jonas wrote: > T

Re: [web2py] page min height

2012-11-22 Thread Jonas Fredriksson
Hi. I tried the link and more or less copied the code but the sticky footer don't work. especially the push seems not to work. here is my code: page header span4 span8 span10 span2 sticky footer? On Thursday, November

[web2py] difference between crud.select(db.hem,query) and db(query).select()?

2012-06-26 Thread Jonas Fredriksson
hi When doing results=crud.select(db.hem,query) I got a list containing the result with html tags in the beginning and the end. But I am not able to access different fields like result.info and so on. When I am using results=db(query).select() I can do results.info. Is there any way to get in