Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
6214 Weergaven

Using JS, the field in the view is updated, but pressing the save button does, not save the value in the field.

JS code:

var FormController = require('web.FormController');
FormController.include(
{
_onButtonClicked: function (event)
{
if(event.data.attrs.id === "action_addpoint")
{
$("input[name='points'].o_input_points")
.val("save_a_modified_field_with_JS")
.focus()
.change();
}
},
});

XML Code:

<header>
<button id="action_addpoint" string="Add point"/>
</header>
<group col="4">
<field name="points" class="points"/>
</group>
Avatar
Annuleer
Beste antwoord

I had the same problem.

Try this. This still does not work for relational fields fields though but will work for others. 

$ ("input [name = 'points']. O_input_points") .val ("save_a_modified_field_with_JS"). change (). focus ();
Avatar
Annuleer
Beste antwoord

Thanks bro is very helpful

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
aug. 20
5373
2
dec. 18
27419
1
aug. 15
5506
0
mrt. 15
5010
1
mei 24
1400