Today, EasyUI datagrid is used as the list. Some data needs to be formatted. When determining the status of a field, it is found that the corresponding formatter function does not work.
<Table id = "list_data" title = "unaudited report" class = "easyui-datagrid" style = "width: auto; height: 350px; "url =" "toolbar =" # toolbar "pagination =" true "pagesize =" 10 "total =" 20 "rownumbers =" true "fitcolumns =" true "singleselect =" true ""pagelist =" [] "loadmsg =" loading data, please wait... "> <thead> <tr> <th data-options =" field: 'report name', width: 200, align: 'center' "> report name </th> <th data-options =" field: 'report group', width: 80, align: 'center' "> report group </th> <th data-options =" field: 'report type', width: 80, align: 'center' "> report type </th> <th data-options =" field: 'report category', width: 80, align: 'center' "> report Category </th> <th data-options =" field: 'tabulation person ', width: 80, align: 'center' "> reported by </th> <th data-options =" field: 'actual output date', width: 90, align: 'center' "formatter =" ChangeDateFormat "> reporting time </th> <th data-options =" field: 'reporting unit ', width: 80, align: 'center' "> Reporting Unit </th> <th data-options =" field: 'audit status', width: 80, align: 'center' "> Audit status </th> <th data-options =" field: 'audit status', width: 80, align: 'center' "formatter =" managerstr "> operation </th> </tr> </thead> </table>
The question is:
<Th data-options = "field: 'audit status', width: 80, align: 'center'" formatter = "managerstr"> operation </th>
Changed to a field that has not been used before. Otherwise, it will not be formatted.
<Th data-options = "field: 'user report number', width: 80, align: 'center'" formatter = "managerstr"> operation </th>
Later I checked and found that if the field value of a column has already appeared before, then it will appear in the same field column. Here, I am "checking status ", it will be used according to the field column that appears for the first time. If no formatter exists for columns with the same field value for the first time, the subsequent formatter will be invalid.
Function managerstr (value, rowData, rowIndex) {if (rowData ["audit status"] = "not reviewed") return "1 "; else if (rowData ["review status"] = "retrieved and refilled") return "2"; else return "reviewed, not allowed ";}