EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Aod47 on February 21, 2018, 07:55:15 PM



Title: How to formatter datagrid column when columns & rows from json file
Post by: Aod47 on February 21, 2018, 07:55:15 PM
My datagrid column and rows from json file. (json file generate from asp.net .ashx page)
It work perfectly but when I add formatter option to column, chrome thrown error 'col.formatter is not a function'

Code:
"columns":[[
{"field":"ck","title":"Case","align":"center","checkbox":true},
{"field":"barcode","title":"Barcode","align":"left"},
{"field":"sn","title":"Serial No","align":"left"},
{"field":"regNumber","title":"Register No","align":"left"},
{"field":"last_time","title":"Last Time","align":"left"},
{"field":"cmd","title":"CMD","align":"center","formatter":"formatCmd"}
]]

I changed to  {...,"formatter":"formatCmd()"} and {...,"formatter":formatCmd} but had the same error result.

Could you please advice. Thank you


Title: Re: How to formatter datagrid column when columns & rows from json file
Post by: Aod47 on February 21, 2018, 10:57:50 PM
OK. I found the answer at topic.

https://www.jeasyui.com/forum/index.php?topic=5480.0 (https://www.jeasyui.com/forum/index.php?topic=5480.0)