how to avoid "SyntaxError: Octal literals are not allowed in strict mode" message with jqGrid filterloader

how to avoid "SyntaxError: Octal literals are not allowed in strict mode" message with jqGrid filterloader

在 jqGrid 过滤器工具栏中,当我在具有前导零的数值列(例如 01、02、00 等)上搜索数值时,然后

SyntaxError: Octal literals are not allowed in strict mode

消息来了。请帮帮我。

问题的存在是因为 jqGrid 生成了类似 parseFloat(01)(对于 formatter: "float"formatter: "number")或 parseInt(01, 10)(对于 formatter: "integer")的代码,如果输入01 在搜索字段中。

我修复了错误(参见 the commit) in free jqGrid. You can try the latest code directly from GitHub if you would use URLs described in the wiki:

<link href="//rawgit.com/free-jqgrid/jqGrid/master/css/ui.jqgrid.css" rel="stylesheet">
<script src="//rawgit.com/free-jqgrid/jqGrid/master/js/i18n/grid.locale-de.js"></script>
<script src="//rawgit.com/free-jqgrid/jqGrid/master/js/jquery.jqgrid.src.js"></script>

(如果使用本地文件中的 URL,则应添加 http:https: 前缀)