Re: [web2py] Re: web2py ajax function in py4web

2020-11-09 Thread Tom Campbell
Also, Stifan, could you post a few use cases? py4web includes vue.js by default and I am trying to understand the most common use cases of this for documentation purposes. I am guessing: - Instant form update on client side when a value is changed (for example, a star rating or even a compli

[web2py] Re: web2py ajax function in py4web

2020-11-09 Thread Jim S
Stifan Can you post this in the py4web group? In py4web we don't include any jquery components. The goal is to be as light as possible and require as few additional packages as possible. I think you'll get better visibility on the py4web list to get this question answered. I know there are

[web2py] web2py ajax function in py4web

2020-11-07 Thread 黄祥
http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#The-ajax-function how to achieve this in py4web ? thx n 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

[web2py] Re: web2py ajax function - checkbox form element value

2017-03-14 Thread 黄祥
the value of checkbox is either on or None *e.g.* *controllers/default.py* def callback(session_order_product): counter = int(request.vars.counter) if request.vars.action == 'adjust_factory': id = int(request.vars.id) factory = request.vars.factory if factory == 'on': factory = 'None' session_order

[web2py] web2py ajax function - checkbox form element value

2017-03-14 Thread wdtnh
I'm using the web2py ajax function and it works fine except that the 2nd argument of the ajax function which is a list of names for the form elements includes one that is a checkbox. The ajax submission passes along the value of "on" I know that the I don't if the ajax

[web2py] AJAX function

2014-07-25 Thread wdtnh
I've got a fairly substantial page with a lot of data in it that I don't want to keep reloading the page so I'm using the AJAX function provided with web2py and pulling the data from a SQLFORM used in the view page. Question I have is, I'm using validate_and_insert function, I was wondering is

[web2py] Ajax function

2013-11-13 Thread Luca Dalla Palma
Hello, this is my *view* on the *controller *I build a function containing the folowing code: pippone='ciao' stringa.append("jQuery('#paginatore').html('%s');" % pippone()) print pippone return stringa The console says ciao (the HTML generated appears to be right) When the function returns, I

[web2py] ajax function is not called when passing non-ascii characters as arguments

2013-09-20 Thread Dragan Matic
On my page I have a set of links (page types) that loads its content dynamically when user clicks on the link. Clicking on each link calls a "LoadPage" javaScript function that calls python function that loads page content and puts it in "pageType" DIV. function LoadPage(pageType) {

[web2py] Ajax function and returning Row, not string

2013-06-18 Thread lesssugar
I'm building a cascading dropdown lists. I use web2py ajax function to do it. My code: select 1 (parent): {{=OPTION('-- Choose department --', _value="")}} {{for d in departments:}} {{=OPTION(d.name, _value=d.id)}} {{pass}} sel

[web2py] ajax function in a grid, I'm getting None in a request.vars

2013-03-29 Thread Tim Richardson
I'm trying to learn more about LOAD and ajax. I have an SQLFORM.grid loaded as a component. It's read only. I've added a button to each row using links = [lambda row: INPUT(_name='toggle',_type="submit",_value="Toggle", _onclick="ajax('toggle_order_import_v2',['id'

[web2py] Re: web2py ajax function returns only non readonly fields

2012-07-09 Thread Anthony
On Monday, July 9, 2012 11:58:45 AM UTC-4, Yuval wrote: > > To duplicate the fields once as a label and once as a hidden field? > Its doable, but not too classy, Tx. > Feel free to submit a patch. :-)

[web2py] Re: web2py ajax function returns only non readonly fields

2012-07-09 Thread Yuval
To duplicate the fields once as a label and once as a hidden field? Its doable, but not too classy, Tx. On Monday, July 9, 2012 8:21:00 AM UTC-7, Anthony wrote: > > You might put the value in a hidden field as well. > > Anthony > > On Monday, July 9, 2012 11:09:50 AM UTC-4, Yuval wrote: >> >> The

[web2py] Re: web2py ajax function returns only non readonly fields

2012-07-09 Thread Anthony
You might put the value in a hidden field as well. Anthony On Monday, July 9, 2012 11:09:50 AM UTC-4, Yuval wrote: > > The ajax function is defined as: > ajax(url, [name1, name2, ...], target) > > where the 'name1' 'name2' are defined as ids of an input fields. > *This is working fine for fields

[web2py] web2py ajax function returns only non readonly fields

2012-07-09 Thread Yuval
The ajax function is defined as: ajax(url, [name1, name2, ...], target) where the 'name1' 'name2' are defined as ids of an input fields. *This is working fine for fields that are defined as:* * Field('first_name', label=T('First Name')) When the field is set to be read only, it is rendered as a l

[web2py] ajax function with eval : return js function from controller

2011-11-08 Thread Vineet
In layout.html, I have {{response.files.append(URL(r=request,c='static',f='js/xyz.js'))}} xyz.js contains a function abc(x){ code line1; code line 2; In a View, there is --> ajax('{{=URL("salhead_edit")}}, [], ':eval'); "salhead_edit" returns js function --> 'abc(myvar1)' But it is not ev

[web2py] ajax function with eval : return js function from controller

2011-11-08 Thread Vineet
In layout.html, I have {{response.files.append(URL(r=request,c='static',f='js/xyz.js'))}} xyz.js contains a function abc(){ code line1; code line 2; In a View, there is --> ajax('{{=URL("salhead_edit")}}, [], ':eval'); "salhead_edit" returns js function --> 'abc(myvar1)' But it is not eval

[web2py] ajax function with eval : return js function from controller

2011-11-08 Thread Vineet
In layout.html, I have {{response.files.append(URL(r=request,c='static',f='js/xyz.js'))}} xyz.js contains a function abc(){ code line1; code line 2; In a View, there is --> ajax('{{=URL("salhead_edit")}}, [], ':eval'); "salhead_edit" returns js function --> 'abc(myvar1)' But it is not eval

[web2py] ajax function : None returned

2011-10-06 Thread Vineet
I was studying ajax function. Exactly reproduced the code from web2py book. =default/one.html {{extend 'layout.html'}} ==default.py=== def one(): return dict() def echo(): return request.vars.name After typing anything in the input box

[web2py] ajax function returns None

2011-08-16 Thread Martin Weissenboeck
Hi, I have tried the example from chapter 10.3 The ajax Function Controller: def one(): return dict() def echo(): return request.vars.name one.html: {{extend 'layout.html'}} No success, because the value of request.vars.name is None Just for fun I have tried "request.now", "reques

[web2py] ajax function submit on script

2011-04-28 Thread 黄祥
hi, is it possible to put ajax function submit on script? e.g. jQuery(document).ready(function(){ jQuery('.view').click(function() {jQuery('.comments').slideToggle()}); jQuery('.post').click(function(){jQuery('.form').slideToggle()}); jQuery('.post').submit(function(){ajax('blog_show'

[web2py] ajax function

2011-04-05 Thread leone
Hi, sometimes I need to use ajax function passing as second argument a list of ids and costants. There is a way to pass to callback values of elements by id, AND string costants? Thanks for help.

[web2py] ajax function target id null

2010-06-24 Thread ilovesss2004
Hi, I use the ajax function as follows: ajax('func1', ['id1'], '') because I don't need to send some value to the html page, so I set the third parameter null. But IE raises error 'document.getElementById(...)' is null or not an object. How can I use the ajax function when I don't want to send v

[web2py] Re: problems using web2py ajax function

2010-04-03 Thread ciastek
Thank you Russell, your suggestion works great. I use hello! On Mar 29, 3:46 am, mdipierro wrote: > I think you can. I have not tried it. Mind that you have to ecape the > args. > > On Mar 28, 7:56 pm, Russell wrote: > > > Is there a reason not to simply place the constant in the args? > >ajax('

[web2py] Re: problems using web2py ajax function

2010-03-28 Thread mdipierro
I think you can. I have not tried it. Mind that you have to ecape the args. On Mar 28, 7:56 pm, Russell wrote: > Is there a reason not to simply place the constant in the args? > ajax('show_month/3',[],'test') > > or if you want to be explicit... > ajax('show_month?month_to_show=3',[],'test') > >

[web2py] Re: problems using web2py ajax function

2010-03-28 Thread Russell
Is there a reason not to simply place the constant in the args? ajax('show_month/3',[],'test') or if you want to be explicit... ajax('show_month?month_to_show=3',[],'test') On Mar 29, 4:24 am, mdipierro wrote: > Normally if I want to pass a constant, I put it in a hidden field and > then pass t

[web2py] Re: problems using web2py ajax function

2010-03-28 Thread mdipierro
Normally if I want to pass a constant, I put it in a hidden field and then pass the name of the hidden field. On Mar 28, 10:14 am, salbefe wrote: > Thanks, > > Now is clear to me. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this

[web2py] Re: problems using web2py ajax function

2010-03-28 Thread salbefe
Thanks, Now is clear to me. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visi

[web2py] Re: problems using web2py ajax function

2010-03-27 Thread mdipierro
Not sure what you mean by ajax('show_month',[3],'test') the second argument of ajax had to be a list of IDs if fields. The values of those fields will be passed. On 27 Mar, 06:00, salbefe wrote: > Hello, > > With the following code: > > >      {{=month_str}} span> >     > > > I get the foll

[web2py] problems using web2py ajax function

2010-03-27 Thread salbefe
Hello, With the following code: {{=month_str}} I get the following javascript error message: document.getElementById(s[i]) is null I do not why I'm getting that error. I think this code is very similar to the same on page 274 of the web2py book. -- You received this message becau