无法打印道场增强网格

时间:2012-09-05 11:13:16

标签: javascript dojo grid

我有一个增强的网格并激活了“打印机”插件。此外,我已经制作了一个dijit /按钮并将其连接到一个调用print方法的onClick事件。事件被解雇所以没有问题。问题是,它不起作用。我在Opera控制台中收到以下消息:

Uncaught exception: TypeError: Cannot convert 'str' to object

Error thrown at line 511, column 21 in <anonymous function: trim>(str) in http://localhost/ci/assets/js/dojo/_base/lang.js:
return str.trim();
called from line 131, column 3 in <anonymous function: _loadCSSFiles>(cssFile) in http://localhost/ci/assets/js/dojox/grid/enhanced/plugins/Printer.js:
cssFile = lang.trim(cssFile);
called from line 282, column 5 in <anonymous function: map>(arr, callback, thisObject, Ctr) in http://localhost/ci/assets/js/dojo/_base/array.js:
out[i] = callback(arr[i], i, arr);
called from line 130, column 2 in <anonymous function: _loadCSSFiles>(cssFiles) in http://localhost/ci/assets/js/dojox/grid/enhanced/plugins/Printer.js:
var dl = array.map(cssFiles, function(cssFile){
called from line 226, column 2 in <anonymous function: _wrapHTML>(title, cssFiles, body_content) in http://localhost/ci/assets/js/dojox/grid/enhanced/plugins/Printer.js:
return this._loadCSSFiles(cssFiles).then(function(cssStrs){
called from line 125, column 3 in <anonymous function: exportSelectedToHTML>(str) in http://localhost/ci/assets/js/dojox/grid/enhanced/plugins/Printer.js:
_this._wrapHTML(args.title, args.cssFiles, args.titleInBody + str).then(onExported);
called from line 128, column 2 in <anonymous function: exportSelected>(type, writerArgs, onExported) in http://localhost/ci/assets/js/dojox/grid/enhanced/plugins/Exporter.js:
return onExported(this._goThroughGridData(this.grid.selection.getSelected(), writer));
called via Function.prototype.apply() from line 375, column 68 in <anonymous function: hitch>() in http://localhost/ci/assets/js/dojo/_base/lang.js:
return method.apply(scope, arguments || []);
called from line 124, column 2 in <anonymous function: exportSelectedToHTML>(args, onExported) in http://localhost/ci/assets/js/dojox/grid/enhanced/plugins/Printer.js:
this.grid.exportSelected("table", args.writerArgs, function(str){
called from line 94, column 2 in <anonymous function: printSelected>(args) in http://localhost/ci/assets/js/dojox/grid/enhanced/plugins/Printer.js:
this.exportSelectedToHTML(args, lang.hitch(this, this._print));

以下是该活动的代码:

                require([
                    "dijit/registry"
                ],function(registry) {
                    var grid = registry.byId('grid');
                    grid.printSelected({
                        "title": "test"
                    });
                });

有人知道我能做什么,让这个插件上班?
PS:我也尝试使用谷歌浏览器进行打印,但这两种方法都没有用......

0 个答案:

没有答案