paquedo
(Fcomjimenez)
February 5, 2015, 7:20am
1
Hello,
I’m doing a Yii aplication. I have this screen, a permission’s list to assign a role. This works correctly with controller action, but I like that works by ajax, when I click in the on/off slider, run the action within charge the page.
How can I do this?
Thanks
paquedo
(Fcomjimenez)
February 5, 2015, 7:45am
2
I forget, this is the code that show the on/off slider
<a href="<?PHP echo Url::to([‘seguridad/assign-permiso’,‘rol’=>$model->name,‘permiso’=>$permiso->name]); ?>">
<input data-no-uniform="true" <?PHP echo $checked; ?> type="checkbox" class="iphone-toggle">
</a>
paquedo
(Fcomjimenez)
February 6, 2015, 10:22pm
3
I found the solution and it’s works by ajax.
Thanks for no solution, bad community.
Quentinb
(Quentin)
February 6, 2015, 10:24pm
4
Why don’t you post the solution here for others?
paquedo
(Fcomjimenez)
February 6, 2015, 11:10pm
5
Because this community don’t help
dniznick
(Dniznick)
February 8, 2015, 7:32am
6
And what have you contributed? You come in here and demand answers and then get upset when nobody answers you within 1 day? Ok.
paquedo
(Fcomjimenez)
February 9, 2015, 10:02pm
7
I think one day is enough time to answer, if someone wants to do
I have not had time to help, but I will if I can
The solution:
<a onclick="$.ajax({type: ‘GET’, url: ‘<?PHP echo Url::to([‘seguridad/assign-permiso’,‘rol’=>$model->name,‘permiso’=>$permiso->name]); ?>’});">
<input data-no-uniform="true" <?PHP echo $checked; ?> type="checkbox" class="iphone-toggle">
</a>