1
我想在dojox.grid.EnhancedGrid中添加篩選器,並且我的網格是以聲明方式創建的。我在data-dojo-props屬性中添加了過濾器。如何在EnhancedGrid中添加篩選器
我的代碼:
<div id="myGrid"
data-dojo-type="dojox.grid.EnhancedGrid"
data-dojo-props="plugins:{indirectSelection: true,nestedSorting: true,
filter: {
closeFilterbarButton: true,
ruleCount: 5,
itemsName: "songs"
} },
store: mystore,
structure: [{
defaultCell: { width: 8, editable: false, type: dojox.grid.cells._Widget, styles: 'text-align: left;' },
rows: [
{ field: 'RN', name: '${RN}', width: '32%',formatter : function(val, rowIdx, cell){
cell.customClasses.push('anchorLookAlike');
return val;
}
},
{ field: 'DC', name: '${DC}', width: '10%' },
{ field: 'PN', name: '${PN}', width: '10%' },
{ field: 'MD', name: '${MD}', width: '10%' },
{ field: 'RD', name: '${RD}', width: '10%' },
{ field: 'UR', name: '${UR}', width: '10%' },
{ field: 'DL', name: '${DL}', width: '10%',formatter: function(datum){
if(datum){
return dojo.date.locale.format(new Date(datum), {selector: 'date', formatLength: 'long'});
}
return '...';
}
},
{field: 'RP', name: '', hidden: true}
]
}]"></div>
當我嘗試運行此代碼現在面臨這個錯誤,
dojo/parser::parse() error
Error: SyntaxError: syntax error in data-dojo-props='plugins:{indirectSelection: true,nestedSorting: true, filter: { closeFilterbarButton: true, ruleCount: 5, itemsName:
如何正確添加過濾器?可以幫助我
謝謝傑夫法語。我糾正了我的錯誤,它工作正常。 – KSK