Hey (little noob here),

If you can generate
<button id='2011-08-17' class='acAddTime'>+</button>
can't you generate
<button id='2011-08-17' class='acAddTime'
onClick='addButtonCallback("2011-08-17")'>+</button>
?

And the Ajax function changes to
*function addButtonCallback(myDate) {
so that you can access to "2011-08-17" in your function.
I don't know anything about the Ajax->web2py aspect, but the pure Ajax
aspect, should work as it ;)


On Aug 17, 12:00 am, IK <[email protected]> wrote:
> Hi,
>
> I'm trying to implement this jquery 
> pluginhttp://collectivegarbage.wordpress.com/2011/06/22/abhorred-calendar<http://collectivegarbage.wordpress.com/2011/06/22/abhorred-calendar/#...>,
> check the demohttp://mithundaa.kodingen.com/and 
> githubhttps://github.com/mithun-daa/abhorredCalendar. I was playing with this 
> for
> few days, I tried to reuse examples in book and I searched throughout this
> group, but couldn't crack it or find similar examples or behavior.
>
> Could somebody suggest what would be jquery code for button ajax call?
>
> in view, jquery function which triggers onclick event to increase hours by
> one is:
>
> *function addButtonCallback() {*
> *         //I need this code*
> *         //not sure how to pass button id="2011-08-16" value as variable to
> web2py (request.vars.name worked at some stage but if I try with id, output
> is None )*
> *        }*
>
> html code for button id value is dynamically generated
>  <button id='2011-08-17' class='acAddTime'>+</button> <!-- I guess, inside
> button should go onclick?? -->
>
> let's say this is the model
>
> ## model
> db.define_table("calendar",
>     Field('date',type="date"),
>     Field('hours',type="integer"))
>
> Controller should be easy enough to write once jquery part is sorted and
> variables are passed to web2py... I hope ;)
>
> Thanks for your help
>
> Regards,
> IK

Reply via email to