如何在 Sencha Touch 应用程序的选择字段内自定义列表?
How to custom list inside of selectfield of Sencha Touch app?
我想在 Sencha Touch 应用程序中自定义选择字段列表,例如我需要指示 variableHeight
参数,因为我的文本很长..
谢谢
第一步
您需要将自定义 css 添加到您的选择字段列表。
a) onFocus of the selectfield 你需要改变listPanel的宽度
onFocus: function (e) {
this.callParent(arguments);
this.listPanel.setWidth(180);
}
或
a) 在显示 listPanel 时获取选择字段
sf = Ext.Viewport.down('selectfield[action=mySelectfield]');
b) 设置面板的宽度
sf.listPanel.setWidth(180)
或
使用css:
.x-select-overlay{
.x-list {
x-list-item {
---> here goes your code
}
}
}
我想在 Sencha Touch 应用程序中自定义选择字段列表,例如我需要指示 variableHeight
参数,因为我的文本很长..
谢谢
第一步 您需要将自定义 css 添加到您的选择字段列表。
a) onFocus of the selectfield 你需要改变listPanel的宽度
onFocus: function (e) {
this.callParent(arguments);
this.listPanel.setWidth(180);
}
或
a) 在显示 listPanel 时获取选择字段
sf = Ext.Viewport.down('selectfield[action=mySelectfield]');
b) 设置面板的宽度
sf.listPanel.setWidth(180)
或
使用css:
.x-select-overlay{
.x-list {
x-list-item {
---> here goes your code
}
}
}