jqgrid - 编辑类型选择,HTML 编码数据显示不正确
我正在执行内联编辑,并将其中一列的编辑类型设置为下拉菜单。下拉列表中 JSON 中的一些条目具有 html 编码字符 – 这导致下拉列表中显示“未定义”条目。
: 列的定义:
{
"name":"id_secretary",
"index":"id_secretary",
"hidden":false,
"edittype":"select",
"editable":true,
"formatter":"select",
"editoptions": {
"value":"null:; … 87604:NKWABI NG'HNGE;87613:NSOMA MIGAMBA;87629:NTUBI NSHAAHI;87608:NZEGELA MADUHU;87600:NZILA MALUGU;87606:NZILINZI AMINI;87591:PIUS NGWALALI;87586:SAGANDA JOHN;87607:SAKA NG'HONGE;87618:SALU ND'HWANI;87614:SEMELA MALAGU;87625:SHAURI KILULU;87621:SHILINGI KILULU;87585:SULAY SHIJA;87623:TIPA KITEJA;87598:TUMA ISEME",
"multiple":false
}
是否有办法处理下拉列表中的 HTML 编码字符或者我返回的 JSON 数据首先不应该包含这些? 谢谢!
I am performing an inline edit, and have the edit type of one of the columns set to be a drop down. Some of the entries in JSON for the drop down have html encoded characters – which is causing an entry of "undefined" to be displayed in the drop down.:
Definition of the column:
{
"name":"id_secretary",
"index":"id_secretary",
"hidden":false,
"edittype":"select",
"editable":true,
"formatter":"select",
"editoptions": {
"value":"null:; … 87604:NKWABI NG'HNGE;87613:NSOMA MIGAMBA;87629:NTUBI NSHAAHI;87608:NZEGELA MADUHU;87600:NZILA MALUGU;87606:NZILINZI AMINI;87591:PIUS NGWALALI;87586:SAGANDA JOHN;87607:SAKA NG'HONGE;87618:SALU ND'HWANI;87614:SEMELA MALAGU;87625:SHAURI KILULU;87621:SHILINGI KILULU;87585:SULAY SHIJA;87623:TIPA KITEJA;87598:TUMA ISEME",
"multiple":false
}
Is there a way to handle HTML encoded characters in the drop down, or should the JSON data I return not contain these in the first place?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信 javascript 和 jqgrid 都有 htmlDecode() 函数,应该可以为您修复这些实体。
I believe both javascript and jqgrid have htmlDecode() functions that should be fix those entities right up for you.
也许您可以尝试使用 jqgrid 参数,设置:
autoencode: true
我希望 jqGrid 选项 autoencode: true 能够解决您的问题。
Maybe you can try to use a jqgrid parameter for that, set:
autoencode: true
I hope that jqGrid option autoencode: true will solve your problem.