Because we don’t have dynamic action for on check?
I need to perform a dynamic action when selected, and another when deselected
Because we don’t have dynamic action for on check?
I need to perform a dynamic action when selected, and another when deselected
Hi Adriano,
What needs to be done? Run one action if the checkbox is checked, and another if unchecked?
If yes, which are the two actions that need to run?
yes that
Then:
On Check
add_item.load({token: var_tokem.value, id: id, valor: ‘250.00’, horas: horas.value, nome: nome, idcliente: cliente_id.value, projeto: nome_projeto.value})
On unselect
delete_item.load({token: var_tokem.value, id: id, valor: ‘250.00’, horas: horas.value, nome: nome, idcliente: cliente_id.value, projeto: nome_projeto.value})
Then you need:
dmx-on:change="input1.checked ? delete_item.load({token: var_tokem.value, id: id, valor: ‘250.00’, horas: horas.value, nome: nome, idcliente: cliente_id.value, projeto: nome_projeto.value}) : add_item.load({token: var_tokem.value, id: id, valor: ‘250.00’, horas: horas.value, nome: nome, idcliente: cliente_id.value, projeto: nome_projeto.value})"
replace input1.checked
with your checkbox input name.
Looks really nice!
Please don’t forget to post in the showcase section when its done
Teodor after upgrade that stopped working
it’s not working anymore
What stopped working exactly, Adriano?
dmx-on:change="input1.checked ? delete_item.load({token: var_tokem.value, id: id, valor: ‘250.00’, horas: horas.value, nome: nome, idcliente: cliente_id.value, projeto: nome_projeto.value}) : add_item.load({token: var_tokem.value, id: id, valor: ‘250.00’, horas: horas.value, nome: nome, idcliente: cliente_id.value, projeto: nome_projeto.value})"
Try using dmx-on:changed
instead.
Adriano,
dmx-on:changed does not work
Ok, we are going to check this.
Adriano, I just tested this and the dmx-on:change
event is working perfectly fine with the latest version of Wappler.
Not sure what could be wrong on your page.
thanks teodor