maho2nd
21 Jan 2010, 12:37 AM
Ext version tested:
Ext 3.1.0
Adapter used:
ext
css used:
only default ext-all.css
Browser versions tested against:
FF3.5.7 (firebug 1.4.5 installed)
Operating System:
WinXP
Description:
If you call the render method in XMLWriter with no data(records), it renders an empty record in params.xmlData instead of no record
Test Case:
var params = {};
var baseParams = {};
var allRecords = [];
myStore.writer.apply(params, baseParams, 'update', allRecords); params.xmlData is:
<root>
<element></element>
</root>
instead of
<root>
</root>
Fix:
render : function(params, baseParams, data) {
baseParams = this.toArray(baseParams);
params.xmlData = this.tpl.applyTemplate({
version: this.xmlVersion,
encoding: this.xmlEncoding,
documentRoot: (baseParams.length > 0 || this.forceDocumentRoot === true) ? this.documentRoot : false,
record: this.meta.record,
root: this.root,
baseParams: baseParams,
// records: (Ext.isArray(data[0])) ? data : [data]
records: (Ext.isArray(data[0]) || data.length == 0) ? data : [data]
});
}
(last line changed)
Ext 3.1.0
Adapter used:
ext
css used:
only default ext-all.css
Browser versions tested against:
FF3.5.7 (firebug 1.4.5 installed)
Operating System:
WinXP
Description:
If you call the render method in XMLWriter with no data(records), it renders an empty record in params.xmlData instead of no record
Test Case:
var params = {};
var baseParams = {};
var allRecords = [];
myStore.writer.apply(params, baseParams, 'update', allRecords); params.xmlData is:
<root>
<element></element>
</root>
instead of
<root>
</root>
Fix:
render : function(params, baseParams, data) {
baseParams = this.toArray(baseParams);
params.xmlData = this.tpl.applyTemplate({
version: this.xmlVersion,
encoding: this.xmlEncoding,
documentRoot: (baseParams.length > 0 || this.forceDocumentRoot === true) ? this.documentRoot : false,
record: this.meta.record,
root: this.root,
baseParams: baseParams,
// records: (Ext.isArray(data[0])) ? data : [data]
records: (Ext.isArray(data[0]) || data.length == 0) ? data : [data]
});
}
(last line changed)