i need to pass the clickedFlight variable to the controller so that i will
get the other information associated with the clickedFlight in the table,
please show me how to do it. thanks

On Mon, Jul 8, 2019 at 6:06 PM Scott Hunter <shun...@nycap.rr.com> wrote:

> The short answer is, you don't.  Javascript is being executed in the
> browser; controller code is executed on the server.
>
> The longer answer is that the browser can make a request to the server
> (via ajax or some other mechanism) that can cause controller code to be
> executed.  I think you'll need to provide more details of what you are
> trying to do before someone can w/ details.
>
> On Monday, July 8, 2019 at 5:45:29 PM UTC-4, Quang Lam wrote:
>>
>> Hi All, i would like to pass the variable clickedFlight in Jquery in view
>> to one of the functions named custom_view_search in view.py in controller.
>> Please show me how. Thanks
>>
>>
>> $(document.body).on("contextmenu", "table tr", function(e) {
>> var tableData = $(this).children("td").map(function(){
>> return $(this).text();
>> }).get();
>> var clickedFlight = tableData[0]
>> alert(clickedFlight);
>>     contextMenu.css({
>>               display: "block",
>>               left: e.clientX,
>>
>>               //TODO: figure out why I have to hardcode this value to get
>> the menu to appear in correct place
>>               //...Y axis page value not correctly displaying on table
>>               top:  e.clientY - 80
>>          });
>>          return false;
>>
>>     });
>>
> --
> 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)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/5257ab77-2e11-4824-b5b1-1876693d2034%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/5257ab77-2e11-4824-b5b1-1876693d2034%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAKDykLhcFhgbKAM%2B-mcSeY-abjq%2BfGO5LwgZ-5q6CjweFraRhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to