This line

"Delete": {{=URL('controller_name', args=[a,b,..])}}

should be

"Delete": "{{=URL('controller_name', args=[a,b,..])}}"

otherwise this fine. Make sure you do not have any {{ in the JS other
than for web2py takes. If you do break them with a space.

On Sep 30, 11:36 am, Vineet <vineet.deod...@gmail.com> wrote:
> I am trying to use jquery-ui for modal form & dialog.
> In a confirmation dialogue, on click event, i want to call a
> controller action.
> Notice the code for Delete button handler.
>
> [CODE]
> $(document).ready(function() {
> $('.delurl').click(function(e){
>  $("#deptDel").dialog({
>        modal: true,
>        buttons: {
>                 "Delete": {{=URL('controller_name', args=[a,b,..])}}
>
>                 "Cancel": function() {
>                     $( this ).dialog( "close" );
> [/CODE]
>
> Is it all right to use URL helper in javascript function
> OR
> is there any downside in coding like this?
> If so, what is the best practice for such requirement?
>
> Thanks,
> Vineet

Reply via email to