[web2py] Re: SQLFORM.grid, pagination and LOAD helper

2017-08-03 Thread Akash B
Thanks for the suggestion! I added a header check for the web2py-component-element header. I had to manually add the value to response.headers (from request.cid) because I'm using a call to web2py_component I guess. But it works perfectly!! On Thursday, August 3, 2017 at 6:28:07 PM UTC-7, Anth

[web2py] Re: SQLFORM.grid, pagination and LOAD helper

2017-08-03 Thread Anthony
Be careful that your page isn't making any other Ajax requests, as your code is not limited to the component requests only. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issue

[web2py] Re: SQLFORM.grid, pagination and LOAD helper

2017-08-03 Thread Akash B
Thanks Anthony!! I resolved my problem with an ajaxSuccess event handler. I am calling a web2py_component with the target div and using setTimeout to achieve what I want. The code snippet in demo/f1.html is below for anyone who may be interested: my_url = "{{=URL('demo', 'f1.load')}}"; update_i

[web2py] Re: SQLFORM.grid, pagination and LOAD helper

2017-08-02 Thread Anthony
> > I have an alert to verify that the data-w2p_remote is set correctly but > the XHR is still made to the default page. > Is there some sort of a trigger or a function that I can call that lets > the code in web2py.js know that the URL in the data-w2p_remote attribute > was changed? > That wou

[web2py] Re: SQLFORM.grid, pagination and LOAD helper

2017-08-02 Thread Akash B
Thank you for your response. As you suggested, I am currently trying to get around this by manually adding the div layer (instead of LOAD helper) and setting the generated link from the controller using response.js. Snippet below: In demo/f1.html: loading... In controller f1: url =

[web2py] Re: SQLFORM.grid, pagination and LOAD helper

2017-08-02 Thread Anthony
> > >1. My actual goal is to load this grid and keep refreshing it every 10 >seconds through XHR. For this, I created a simple view "demo/f1.load" > which >contains {{=grid}} and the "demo/f1.html" view has the following: >{{=LOAD('demo', 'f1.load', ajax=True, content='Loading..

[web2py] Re: SQLFORM.grid pagination problem

2014-05-05 Thread Elcimar
I started adding @cache on my functions without thinking the consequences. For example, I have a function that returns that grid. So caching that function would be a bad idea. =/ Em domingo, 4 de maio de 2014 15h59min11s UTC-3, Niphlod escreveu: > > what do you mean by "a wrong implementation o

[web2py] Re: SQLFORM.grid pagination problem

2014-05-04 Thread Niphlod
what do you mean by "a wrong implementation of cache" ? On Sunday, May 4, 2014 2:14:40 PM UTC+2, Elcimar wrote: > > I will keep testing it for sure. > I also was wondering if a wrong implementation of cache would cause this. > > -- Resources: - http://web2py.com - http://web2py.com/book (Docu

[web2py] Re: SQLFORM.grid pagination problem

2014-05-04 Thread Elcimar
I will keep testing it for sure. I also was wondering if a wrong implementation of cache would cause this. -- 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) -

[web2py] Re: SQLFORM.grid pagination problem

2014-05-03 Thread Niphlod
the redis backend usues the same "logic" as session files, so a "bug" in the code would show anyway... to make a grid A go to page # means that you left another grid B at page # if you're using defaults without specifying the formname argument. I don't think there's another "hole" that makes gr

[web2py] Re: SQLFORM.grid pagination problem

2014-05-03 Thread Elcimar
Well... - It happens when the app is in production. - It magically happens SOME(random)TIMES simply by opening the page and hitting F5. - It doesn't happen when I'm testing it in my development virtualbox vm. - Nope, I'm not using reserved keywords, I prefer using im my native language. I sus

[web2py] Re: SQLFORM.grid pagination problem

2014-05-02 Thread Niphlod
does this "magically" happens when you just left another grid at page # 1000 ? because that would be expected, since all grids share the same session values to "remember" what the page # is. Also, please make sure you're not using "reserved" request.vars (i.e. page=x) because then you're tricki

[web2py] Re: SQLFORM.grid pagination and messed up URL

2014-03-03 Thread Anthony
OK, I've tried to clarify a bit. Anthony On Monday, March 3, 2014 7:31:42 AM UTC-5, mcamel wrote: > > Anthony, > > Would you mind to make a patch to the manual to clarify this thing?. > > Actual explanation is quite obscure and i'm not sure to understand > completely what it means: > > the args

[web2py] Re: SQLFORM.grid pagination and messed up URL

2014-03-03 Thread mcamel
Anthony, Would you mind to make a patch to the manual to clarify this thing?. Actual explanation is quite obscure and i'm not sure to understand completely what it means: the args argument of the grid specifies which request.args should be passed > along and ignored by the object Regards.

[web2py] Re: SQLFORM.grid pagination and messed up URL

2014-02-28 Thread Anthony
If the base URL for the grid includes args, you have to tell the grid to preserve those args when it generates its own URLs. For example: grid = SQLFORM.grid(..., args=request.args[:2]) Anthony On Friday, February 28, 2014 8:18:04 PM UTC-5, horridohobbyist wrote: > > I have a SQLFORM.grid with

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-25 Thread Anthony
:-) On Wednesday, July 25, 2012 8:41:42 PM UTC-4, dave wrote: > > Thank you very much this solved the problem, very nice people around, I > guess im sticking to web2yp for my framework of choice > --

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-25 Thread dave
Thank you very much this solved the problem, very nice people around, I guess im sticking to web2yp for my framework of choice --

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-25 Thread Anthony
Yeah, it looks like the query string isn't propagated to the links within the table. However, you can propagate URL args by specifying the "args" argument to .grid(). Maybe something like this: {{=LOAD('default', 'ajaxTable2.load', args=[60], ajax=True, target='grid')}} $('#input4').keyu

Re: [web2py] Re: SQLFORM.grid pagination refresh

2012-07-25 Thread dave
I actually dont want 60, I just gave that as an example --

Re: [web2py] Re: SQLFORM.grid pagination refresh

2012-07-25 Thread Alec Taylor
query = (db.applicant.id > 0) & (db.applicant.id < (request.vars.count or 60)') On Wed, Jul 25, 2012 at 5:13 PM, dave wrote: > ok so this is what I have for the view > > > $('#input4').keyup(function(){ > input_value = $("#input4").val(); > web2py_component('{{=URL("default", "aj

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-25 Thread dave
ok so this is what I have for the view $('#input4').keyup(function(){ input_value = $("#input4").val(); web2py_component('{{=URL("default", "ajaxTable3.load")}}' + '?count=' + input_value, 'grid'); }); and this is the controller function def ajaxTable3(): query = (db.appli

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-24 Thread Anthony
Then don't use the ajax() function. Instead, create a jQuery event handler to capture the keyup event. Then, in the handler, grab the input value and refresh the component by calling: web2py_component('{{=URL("default", "ajaxTable2.load")}}' + '?count=' +input_value , 'grid') In that case, the

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-24 Thread dave
The problem is when I filter using input boxes from outside, I need to use the ajax function from the view, like , and I do replace the load function which is inside the div grid {{=LOAD('default','ajaxTable2.load',ajax=True, target='grid', content='loading...')}} when the first page lo

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-23 Thread Anthony
I see. I was responding to your request for filtering (e.g., showing only 50 records). If you put the grid in a web2py component (e.g., via LOAD()), then the links should automatically get trapped. Is there a reason you don't want to use a component? Anthony On Monday, July 23, 2012 5:09:52 PM

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-23 Thread dave
the problem is whatever I do, the clicking the pagination triggers a whole page refresh, the links are not trapped, This describes the problem Trapped Ajax links A Ajax links Normally a link is not trapped, and by clicking in a link inside a component, the entire linked page is loaded. Someti

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-23 Thread Anthony
When you submit a form in an Ajax component, only the component will refresh -- so if you make a filter form contained in the component with the grid, when the form is submitted, it will reload the whole component. You can also customize the grid search widget to do whatever you want -- both "s

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-22 Thread dave
Wow, that was fast, first time asker here, I have an SQLFORM.grid in a view, when I click the pagination links at the bottom of the page 1, 2, 3 etc, the whole page refreshes. To avoid this problem, I created a component and put it in a view {{=LOAD('default','ajaxTable2.load',ajax=True, target

[web2py] Re: SQLFORM.grid pagination refresh

2012-07-22 Thread Massimo Di Pierro
No. On Sunday, 22 July 2012 21:38:15 UTC-5, dave wrote: > > Is there a way for SQLFRORM.grid pagination to not refresh the whole page > without the use of the LOAD function? --

Re: [web2py] Re: SQLFORM.grid pagination

2012-04-11 Thread Keith Edmunds
On Tue, 10 Apr 2012 21:38:15 -0700 (PDT), massimo.dipie...@gmail.com said: > Please open a ticket about this in google code. Added: http://code.google.com/p/web2py/issues/detail?id=758 -- "You can have everything in life you want if you help enough other people get what they want" - Zig Ziglar.

[web2py] Re: SQLFORM.grid pagination

2012-04-10 Thread Massimo Di Pierro
Please open a ticket about this in google code. Should be easy to fix. On Tuesday, 10 April 2012 12:56:48 UTC-5, backseat wrote: > > I have a SQLFORM.grid that says "67 records found", and shows the first 20 > (as I would expect). At the bottom, there are four buttons for the pages > (1-4). If I c