Dinamic events on:check

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?

1 Like

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.

1 Like

Thanks Teodor :love_you_gesture:

a preview of my budgets app :heart_eyes::star_struck::crazy_face:

2 Likes

Looks really nice!
Please don’t forget to post in the showcase section when its done :slight_smile:

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.

there are only these now

Adriano,

dmx-on:changed does not work

Ok, we are going to check this.

1 Like

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