On Sep 11, 2011, at 7:57 PM, Noel Villamor wrote: > I have a button which does the following callback: > > ajax('{{=URL('callback')}}',['btn1'],':eval');" > > Then I have the following callback function in my controller: > > def callback(): > db(db.tbl.id==100).update(data='sampledata') > jquery = ??? > return jquery > > I can use jquery = "alert('Lame table update message');" but it > doesn't appear as good as the response.flash message. > > 1) How do I emulate response.flash?
To emulate response.flash, you need to put the text into the div with class .flash (the page's js refers to it in jQuery just as ".flash"); IIRC you're setting that object's html. Then cause it to show itself however you want to--slideDown, like that. > 2) How to determine if the db update is successful or not so I can > flash the appropriate message. Can't help you there.