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. This problem only happens in firefox. I've found that I can rep开发者_JAVA百科licate 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. Then refreshing the firefox page, everything goes back to the way it was. 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.
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)
{"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
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,
});
Your '&' is being placed directly in the HTML, you need to HTML escape your content.
精彩评论