JQGrid with dynamic columns and server-side functionality
Small recommendations:


It seems to me that you can remove async: false parameter for the $.ajax call.
You can remove result.data from the data returned by the ajax call. (After that you should and the line with var colD = result.data). The data will be not really used because you call trigger('reloadGrid'); immediately.
On the other side the values for sortname and sortorder parameters should be included in the data model (as the properties of result).
You can use url: secondFetchURL, datatype: 'json', mtype: 'POST' parameters directly in the jqGrid definition ( in $("#myGrid").jqGrid({/*here*/});. No trigger('reloadGrid') will be needed.


UPDATED: Look at this and this answers. Probably the approach is what you need from the dynamic columns.

You can take a look in the answer in case if you will need to use custom formatters.