EasyUI DataGrid 中字段 formatter 格式化不起作用

今天用 EasyUI datagrid 来做列表,要对一些数据进行格式化,推断某字段状态时,发现 formatter 格式化相应的函数不起作用。


<table id="list_data" title="未审核报表" class="easyui-datagrid" style="width: auto;height:350px;" url=""toolbar="#toolbar" pagination="true" pagesize="10" total="20"rownumbers="true" fitcolumns="true" singleselect="true" pagelist="[10,20]" loadmsg="正在努力载入数据,请稍后..."><thead><tr><th data-options="field:'报表名称',width:200,align:'center'">报表名称</th><th data-options="field:'报表分组',width:80,align:'center'">报表分组</th><th data-options="field:'报表类型',width:80,align:'center'">报表类型</th><th data-options="field:'报表分类',width:80,align:'center'">报表分类</th><th data-options="field:'制表人',width:80,align:'center'">上报人</th><th data-options="field:'实际报出日期',width:90,align:'center'" formatter="ChangeDateFormat">上报时间</th><th data-options="field:'填报单位',width:80,align:'center'">上报单位</th><th data-options="field:'审核状态',width:80,align:'center'">审核状态</th><th data-options="field:'审核状态',width:80,align:'center'" formatter="managerstr">操作</th></tr></thead>
</table>


出问题是这句:

<th data-options="field:'审核状态',width:80,align:'center'" formatter="managerstr">操作</th>

改成,前面没有出现过的字段,否则,不会进来格式化的。

<th data-options="field:'用户报表编号',width:80,align:'center'" formatter="managerstr">操作</th>


后来检查发现 : 假设某列的 field值,在前面已经出现过,则后出现的同field列,在这里,我的是 “审核状态”,将按第一次出现的field列使用。假设第一次出现的field同值的列没有formatter,兴许的formatter将无效。

function managerstr(value,rowData,rowIndex) {if (rowData["审核状态"] == "未审核")return "1";else if (rowData["审核状态"] == "已取回重填")return "2";elsereturn "已经审核,不同意操作";}



 
 
 
 
 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/546290.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

PyQt5单击QTableView垂直表头verticalHeader获取行数据以及单击单元格获取行数据操作

PyQt5单击QTableView单元格获取单元格数据,很容易实现,从而可以实现获取这一行的数据。但是单击QTableView垂直表头verticalHeader获取行数据,我摸索了一周时间才解决,下面分享下重点。 1.利用PyCharm及Python语言创建PyQt5主界面 添加tableView控件,编程初始化如下: …

python中acosh_acosh()函数以及C ++中的示例

python中acoshC acosh()函数 (C acosh() function) acosh() function is a library function of cmath header, it is used to find nonnegative area hyperbolic cosine of the given value, it accepts a number (x) and returns the nonnegative area hyperbolic cosine of…

震惊!这样终止线程,竟然会导致服务宕机?

在开始之前&#xff0c;我们先来看以下代码会有什么问题&#xff1f; public class ThreadStopExample {public static void main(String[] args) throws InterruptedException {Thread t1 new Thread(() -> {try {System.out.println("子线程开始执行");// 模拟…

华为交换机系统软件升级和安全漏洞修复教程

华为交换机官网 可以查询到华为交换机官方电话:400-822-9999,通过下面2个命令查询出需要升级的交换机软件版本和补丁版本号发给华为,获取新的升级系统软件和补丁以及升级教程。下面是我升级华为交换机总结的教程,作为参考 <HUAWEI> display version<HUAWEI&g…

python里x.pow2_带有Python示例的math.pow()方法

python里x.pow2Python math.pow()方法 (Python math.pow() method) math.pow() method is a library method of math module, it is used to calculate the given power of a base, it accepts two numbers and returns the first number to the power of the second number in…

想读Spring源码?先从这篇「 极简教程」开始

这是我的第 47 篇原创文章。为什么要阅读源码&#xff1f;这是一个有趣的问题&#xff0c;类似的问题还有&#xff0c;为什么要看书&#xff1f;为什么要爬山&#xff1f;这也是一个哲学问题&#xff0c;我想每个人都有不同的答案&#xff0c;下面我是对阅读源码好处的一些思考…

Linux Shell接收键盘输入

1.read命令格式 read [选项] [变量名] 选项&#xff1a; -p “提示信息”&#xff1a;在等待read输入时&#xff0c;输出提示信息 -t “秒数”&#xff1a; read命令会一致等待用户输入&#xff0c;使用此选项可以指定等待时间 -n “字符数”&#xff1a; read命令只接受指…

机房收费重构之总结篇

《机房收费重构》之路终于接近了尾声&#xff0c;这么一个月的时间做梦都在敲代码。总结《机房收费重构》的道路需要从学习方法&#xff0c;注意问题&#xff0c;知识总结三方面来进行&#xff01; 《机房收费重构》之路的背景&#xff1a; 1.设计模式&#xff1a; 设计模式的思…

带有Python示例的math.exp()方法

Python math.exp()方法 (Python math.exp() method) math.exp() method is a library method of math module, it is used to get the number in exponential form, it accepts a number and returns the number in the exponential format (if the number is x, it returns e*…

想快速拥有个人网站?来试试这个...

一、简介Hugo 是Go语言实现的一款静态网站生成器。它简单、易用、高效、易扩展、快速部署。相比较其他静态网站生成器&#xff0c;它的优点有这几点&#xff1a;项目构建特别快主题目录与站点目录结构一样配置文件为*.toml 格式&#xff0c;语法常简单易懂&#xff0c;没有缩进…

android 类ios actionsheet效果

1.http://blog.csdn.net/zhaoxy_thu/article/details/17733389 2. https://github.com/ojhariddhish/actionsheetdemo

带有Python示例的math.cos()方法

Python math.cos()方法 (Python math.cos() method) math.cos() method is a library method of math module, it is used to get the cosine of the number radians, it accepts a number returns the cosine of the given number radians. math.cos()方法是数学模块的库方法&…

Linux Debian下突然所有命令未找到,显示bash: xxxxx: command not found的解决办法

出现这个问题是因为系统的环境变量没有正确配置造成的。 在终端内执行下面命令&#xff0c;确实可以解决办法&#xff0c;但是当关掉当前的shell窗口或者重启Linux的时候&#xff0c;我就发现又出现了找不到命令的错误。 export PATH/bin:/usr/bin:$PATH下面分享下彻底解决方…

Java对象都是在堆上分配空间吗?答案竟然是...

作者 l Hollis来源 l Hollis&#xff08;ID&#xff1a;hollischuang&#xff09;Java作为一种面向对象的&#xff0c;跨平台语言&#xff0c;其对象、内存等一直是比较难的知识点&#xff0c;所以&#xff0c;即使是一个Java的初学者&#xff0c;也一定或多或少的对JVM有一些了…

c+pow函数的头文件_pow()函数以及C ++中的示例

cpow函数的头文件C pow()函数 (C pow() function) pow() function is a library function of cmath header (<math.h> in earlier versions), it is used to find the raise to the power, it accepts two arguments and returns the first argument to the power of th…

正则表达式 使用分支

正则表达式是非常有用的文本检索工具&#xff0c;这是一个非常简单而全面的教程正则表达式30分钟入门教程。这一篇教程&#xff0c;可以作为快速学习的工具。正则表达式&#xff0c;可能用的不是非常多&#xff0c;只是在Linux下&#xff0c;分析代码时候&#xff0c;用的比较多…

Python pandas读取csv txt excel和mysql数据库文件方法

# _*_coding:utf-8_*_ import os import pandas as pd import pymysql# Press the green button in the gutter to run the script. if __name__ __main__:strFilePath1 os.getcwd() "/天气.csv"df1 pd.read_csv(strFilePath1)print(df1)strFilePath2 os.getcwd…

服务器运行容器工具大盘点!

服务器到底是什么&#xff1f;服务器的硬件好理解&#xff0c;其实就是一台性能、稳定性、扩展性等等比我们普通个人PC强的一台机器而已&#xff0c;它也需要搭载操作系统&#xff0c;比如有专门的Windows Server或者各种Linux发行版系统。只不过咱这里很多小伙伴可能还是处于学…

python函数示例_使用Python中的示例的input()函数

python函数示例Python input()函数 (Python input() function) input() function is a library function, it is used to get the user input, it shows given message on the console and wait for the input and returns input value in string format. input()函数是一个库函…

Python pandas DateFrame查询数据df.loc的5种方法

# _*_coding:utf-8_*_ import pandas as pd# 自定义函数 def func(df):return df[temperature] < 32# Press the green button in the gutter to run the script. if __name__ __main__:data {date: [2022-08-21, 2022-08-22, 2022-08-23],weather: ["晴", &quo…