The grid's checkboxes (and their multiple selection) are not the problem.
The problem is that my origin page has a grid with extra buttons, using the 
selectable option. And I wanted one of the buttons (from the selectable 
option) to open a view in another browser page.
Can I control the buttons from the grid's selectable option from Javascript?


sexta-feira, 8 de Março de 2019 às 23:08:50 UTC, icodk escreveu:
>
> I would do it in javascript in the view and simulate radio buttons, which 
> means that every time the user is selecting a checkbox the script will 
> clear the former selected checkbox. This way you don't have to deal with 
> informing the user, about multiple selections.
>
> On Friday, March 8, 2019 at 9:07:55 PM UTC+1, João Matos wrote:
>>
>> The problem is that my origin page has a grid with extra buttons, using 
>> the selectable option.
>> And that option does not allow using _target or anything similar. It can 
>> only call a function (which is the function on the 1st message).
>> That function checks if there is only 1 record selected in the grid and 
>> if so calls the button action (add, edit, ...)
>> What I would like is for this action to open a new page.
>>
>> Do you see some solution?
>>
>> sexta-feira, 8 de Março de 2019 às 19:39:06 UTC, Leonel Câmara escreveu:
>>>
>>> It's sort of possible using response.js = "window.open(url, '_blank')" 
>>> however any modern browser will consider this a popup and block it because 
>>> it's a window.open that's not coming as a direct result of a click, you can 
>>> then move a step forward fighting with the user's browser preferences and 
>>> instead of using window.open you send javascript that creates an A element 
>>> and clicks it, or even a form that submits to another page.  
>>>   
>>> Don't do this, it won't work reliably. Depending on what you're trying 
>>> to do a good alternative can be to use a modal, or putting a 
>>> _target="_blank" in your form so it submits to a new window.
>>>
>>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to