Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Small recommendations:

  1. It seems to me that you can remove async: false parameter for the $.ajax call.
  2. 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.
  3. On the other side the values for sortname and sortorder parameters should be included in the data model (as the properties of result).
  4. 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 this and this this answers. Probably the approach is what you need from the dynamic columns.

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

Small recommendations:

  1. It seems to me that you can remove async: false parameter for the $.ajax call.
  2. 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.
  3. On the other side the values for sortname and sortorder parameters should be included in the data model (as the properties of result).
  4. 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.

Small recommendations:

  1. It seems to me that you can remove async: false parameter for the $.ajax call.
  2. 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.
  3. On the other side the values for sortname and sortorder parameters should be included in the data model (as the properties of result).
  4. 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.

added 681 characters in body
Source Link
Oleg
  • 166
  • 2
  • 5

Small recommendations:

  1. It seems to me that you can remove async: false parameter for the $.ajax call.
  2. 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.
  3. On the other side the values for sortname and sortorder parameters should be included in the data model (as the properties of result).
  4. 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 .

Small recommendations:

  1. It seems to me that you can remove async: false parameter for the $.ajax call.
  2. 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.
  3. On the other side the values for sortname and sortorder parameters should be included in the data model (as the properties of result).
  4. 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.

Small recommendations:

  1. It seems to me that you can remove async: false parameter for the $.ajax call.
  2. 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.
  3. On the other side the values for sortname and sortorder parameters should be included in the data model (as the properties of result).
  4. 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 .

Source Link
Oleg
  • 166
  • 2
  • 5

Small recommendations:

  1. It seems to me that you can remove async: false parameter for the $.ajax call.
  2. 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.
  3. On the other side the values for sortname and sortorder parameters should be included in the data model (as the properties of result).
  4. 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.
default

AltStyle によって変換されたページ (->オリジナル) /