我有一个与组合框中的显示数组有关的问题。我正在使用extjs。 我能够在组合框下拉列表中显示数组值,但有时它以逗号分隔显示。无法添加换行符。
这是我的观点:CodeList是一个数组列表。
xtype : 'panel',
cls : 'item-text',
items : [{
xtype : 'combobox',
margin : '10 0 0 0',
cls : 'inputtext',
labelCls : 'top-label',
itemId : 'filterform-searchList',
labelAlign : 'top',
fieldLabel : 'search',
store : 'TestStore',
labelCls : 'top-label',
forceSelection : false,
displayField : 'CodeList',
// vtype : digits,
queryMode : 'local',
name : 'fCode',
grow : true,
width : 130,
listConfig: {
getInnerTpl: function() {
// return '<div> ({CodeList.split(",")})</div>';
var fArr = CodeList.split(',');
var splitVal = '';
for (i = 0; i < fArr.length; i++) {
splitVal += fArr[i] + '<br>';
}
// alert(splitVal);
return splitVal;
}
商店:
Ext.define('TestStore', {
extend : 'Ext.data.Store',
proxy : {
type : 'memory',
reader : new Ext.data.ArrayReader({
idIndex : 0,
fields : [{
name : 'fCode'
}],
})
},
sorters : {
property : 'fCode'
}
});
有人可以建议我如何在渲染后拆分显示字段值吗?
由于