[web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-19 Thread Niphlod
_onclick expects a javascript fragment to be executed. On Monday, November 19, 2012 2:40:24 PM UTC+1, Amit wrote: > > Hi, > I have added one custom button after *Search* and *Clear* buttons of > SQLFORM.grid but unable to associate the action onto it, onclick is not > getting called.Please see

[web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-19 Thread Amit
Could you elaborate more on this with some example code? On Monday, 19 November 2012 19:13:58 UTC+5:30, Niphlod wrote: > > _onclick expects a javascript fragment to be executed. > > On Monday, November 19, 2012 2:40:24 PM UTC+1, Amit wrote: >> >> Hi, >> I have added one custom button after *Searc

[web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-19 Thread Niphlod
the _onclick parameter is "translated" to just a plain onclick attribute of the tag you're using. When you do in HTML mylink nothing will happen. an _onclick of "alert('clicked me')" will fire an alert box (language: javascript). What do you need to do upon clicking that button ? --

[web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-19 Thread Amit
upon clicking the button , I need to make query to db and delete the records... On Monday, 19 November 2012 19:23:54 UTC+5:30, Niphlod wrote: > > the _onclick parameter is "translated" to just a plain onclick attribute > of the tag you're using. > > When you do in HTML mylink nothing will > hap

[web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-19 Thread Niphlod
now you're the one that needs explaining it further :P I assume that just going to the "test" function and return back would not be enough ? (i.e. a simple _href=URL('test') on that button) On Monday, November 19, 2012 2:56:36 PM UTC+1, Amit wrote: > > upon clicking the button , I need to make qu

[web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-19 Thread Amit
I simply have to delete the records from the table, but problem what I am facing is : if the function would not be get called then how will I achieve this? On Monday, 19 November 2012 19:31:53 UTC+5:30, Niphlod wrote: > > now you're the one that needs explaining it further :P > I assume that jus

[web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-19 Thread Niphlod
all the records ? if you need to execurte your "test()" function you just need the browser to "go" to that page. Let's assume that in your controller you have def index(): grid = grid(db.testtable) grid[0][1][1].components = [ TAG.button('testbutton', _id="px-delete",_type="butt

[web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-20 Thread Niphlod
whoopsy, did you try with a simple A instead of a button ? TAG.a('Delete',_id="px-delete",_type="button",_href=URL('test')) On Tuesday, November 20, 2012 6:27:18 AM UTC+1, Amit wrote: > > Thanks Niphold for sharing the example code, but still it is not working > means upon clicking on the "Delet

Re: [web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-20 Thread Amit
If I use A instead of button then its calling perfectly but i have to show Delete as a button not as a link. Second observation: if I am adding Delete button/link beside Search and Clear button, and if I click Query input field, its not showing query filling fields(drop down menu,conditional fields

Re: [web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-20 Thread Niphlod
On Tuesday, November 20, 2012 10:19:25 AM UTC+1, Amit wrote: > > If I use A instead of button then its calling perfectly but i have to show > Delete as a button not as a link. > Style the A as a button. With bootstrap's included just add a class = btn . > Second observation: if I am adding D

Re: [web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-20 Thread Amit
Thanks Niphold :), Now its working fineyeah I do agree that I am not so good in Javascript as I am having very less experience on web development..but I am very sure that with the guidance of you people I will definitely learn it fast :). On Tue, Nov 20, 2012 at 4:33 PM, Niphlod wrote: > >