Hi all,
I’m making a custom view for the create and update page for one of my plugins,
Everything was fine, until i wanted to refresh a field when the relationWidget is updated like if a add or remove an item,
i’ve put this in my controller
public function relationExtendRefreshResults($field)
{
// Make sure the field is the expected one
return $this->formRefreshFields('_total');
}
But when i add or remove an item in the relation widget, my dependant field is updated just with the last ajax call.
Example :
- In my relationwidget i have
1 x item A = 100 USD
1 x item B = 100 USD
- at this point my total field shows me 200 USD
- I remove item A, i expect my total field to refresh with 100 USD value, but the ajax response sends 200 USD
- I remove now item B, i expect my total field to refresh with 0 USD value, but the ajax response sends 100 USD
there’s a gap between actions, and i have search in RelationController, and in HasManageMode to fix it, but nothing works,
Could someone help me please ?
Best
Lucas
UDPATE : i’m using OctoberCMS V2