submit grid with form integration doesn't work from javascri

If I submit my grid with form integration it works fine as long as I use button to execute the form submit. Grid changes are included in the submit as expected. BUT if I try to execute the exact same submit using a javascript function with something like document.forms.mygridform.submit(), the grid changes won’t be included in the resulting GET request. Is there a fix for this, or must the form submit always be executed from

If you submit form by javascript , be sure to add next js call

mygrid.parentFormOnSubmit(); //prepare grid for data sending
form.submit(); //submit form