[英]Firefox throws an error in extjs 2.2 JsonStore
I'm experiencing a problem where certain values returned from the server will throw a "code 12" in firebug and cause a floating "Loading" message in extjs that never goes away seemingly hanging my page. 我遇到了一个问题,其中从服务器返回的某些值将在萤火虫中抛出“代码12”,并在extjs中导致浮动的“正在加载”消息,而这些消息似乎从未挂掉我的页面。 This problem only happens in firefox. 此问题仅在Firefox中发生。 I've found that I can replicate the problem consistently by putting an "&" in one of the values that goes in the GridPanel, but other values such as rich-text formatting sometimes will also throw the code 12. I've found that if I go into the page in opera, I can fix the data in my grid panel and save it to the server. 我发现我可以通过在GridPanel中的一个值中放置“&”来一致地复制问题,但是其他值(例如,富文本格式)有时也会抛出代码12。我发现如果进入Opera页面,我可以在网格面板中修复数据并将其保存到服务器。 Then refreshing the firefox page, everything goes back to the way it was. 然后刷新firefox页面,一切恢复原状。 Is there some delimiter or something I can put around these values to keep this from happening? 是否有一些定界符或一些我可以围绕这些值使用的东西,以防止这种情况发生? I extjs can let me save something to the server, I don't understand how getting it back causes a problem. 我的extjs可以让我将某些内容保存到服务器,我不明白如何将其取回会导致问题。
In firebug: 在萤火虫中:
An invalid or illegal string was specified" code: "12
[Break On This Error] (function(){var D=Ext.lib.Dom;var E=Ex...El.cache;delete El._flyweights})})();
Example JSON returned from server (note the "200 & 5" causes an error, "200 and 5" will work fine) 从服务器返回的示例JSON(请注意,“ 200和5”会导致错误,“ 200和5”会正常工作)
{"summaryList":[{"shot":"","seq":"200 & 5","active":9998,"tag":"","file":"","id":"137943329348950905822686689581598049837","quick_comments":"","comments":"","priority":"","asset":"","prod":"dragon","type":"","store":"","submitby":"jstratton","status":"ip","format":"","date":"2011_5_10","approval":"hofx_pm","name":"jstratton","notes":"","uri":"137943329348950905822686689581598049837","dept":"fx","time":"10 May 2011 13:56:30","order":2}], "success":true}
The JSON store and the GridPanel JSON存储和GridPanel
var summaryStore = new Ext.data.JsonStore({
url: 'summaryList',
root: 'summaryList',
baseParams : {
show: showSelect.getValue(),
dept: deptSelect.getValue(),
approval: typeSelect.getValue(),
roundDate: roundDateField.getValue(),
user: summaryUser.getValue(),
},
autoLoad: true,
fields: [],
});
var summaryGrid = new Ext.grid.GridPanel({
store: summaryStore,
columns : [],
// turn off multi-selection for now
tbar : [activeButton,
removeButton,
' ',
exportToSpreadsheetButton,
refreshButton,
],
renderTo: 'summaryTab',
autoHeight: true,
loadMask: {msg: 'Loading information. Thank you for your patience.'},
autoExpandColumn: 'comments',
autoSizeColumns: true,
ddGroup: 'summaryGridDD',
enableDragDrop: true,
viewConfig: {
forceFit: true,
},
titleCollapse : true,
collapsed: false,
stripeRows: true,
title: 'Summary',
frame: true,
});
您的“&”直接放在HTML中,您需要HTML转义您的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.