Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
6187 Vizualizări

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>
Imagine profil
Abandonează
Cel mai bun răspuns

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 ();
Imagine profil
Abandonează
Cel mai bun răspuns

Thanks bro is very helpful

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
aug. 20
5365
2
dec. 18
27393
1
aug. 15
5496
0
mar. 15
4993
1
mai 24
1371