gpt4 book ai didi

javascript - Dojo dgrid,将图标放在插件列树中的每个子行中(PDF、HTML、XSL)

转载 作者:行者123 更新时间:2023-12-02 19:12:37 25 4
gpt4 key购买 nike

我做了一个dojo dgrid,其中有一个树字段(插件列)。我正在尝试将图标(PDF、HTML 和 XLS)放在每个子行中供用户下载。我尝试使用 formatter: function(item, rowIndex, cell) 来创建图标,但它损坏了我的树列,只是停止工作。我在文档中没有找到类似我想要做的事情。

下图显示了我的示例: icons subrows

我也尝试过混合 HTML,但没有成功,而且我不想这样做,将 HTML 与我的 javascript 混合。

我该怎么做?

最佳答案

我不知道这是否是最好的解决方案,但我是这样解决的。

我创建了一个新列(插件列),并在 CSS 中取出了列之间的垂直线(用于模拟 colspan)。但是你可以通过 dgrid 进行 colspan,但我更喜欢通过 CSS(更简单)。

我的插件栏保持这样:

editor({label: ' ', field: 'idDOC', sortable: false, canEdit: function(obj){

if(obj.type == 'DOC'){

if(obj.format == 'xls'){
this.editorArgs.iconClass = 'dijitEditorIcon dijitEditorIconXls';
}

if(obj.format == 'html'){
this.editorArgs.iconClass = 'dijitEditorIcon dijitEditorIconHtml';
}

if(obj.format == 'pdf'){
this.editorArgs.iconClass = 'dijitEditorIcon dijitEditorIconPdf';
}

return true;
}

return false;

}, editorArgs:{onClick: function(obj){

var node = that.memoryStore.get(that.designId);
var format;

for(var i=0; i<node.children.length; i++){

if(node.children[i].id == this._dgridLastValue){
format = node.children[i].format;
}

}

window.location.href = that.domain+'/'+that.designId+'/'+this._dgridLastValue+'/'+format;

}, label:'View', showLabel:true}}, Button),

谢谢

关于javascript - Dojo dgrid,将图标放在插件列树中的每个子行中(PDF、HTML、XSL),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13517052/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com