私の ListItems は、テキストのない空白として表示され続けます。
最初は、アイテムは {field_name} を使用して List オブジェクトの itemTpl 定義で単純にフォーマットされていました。これは問題なく機能しましたが、もちろん機能が制限されていました。
そこで、 dataMap を使用して DataView の ST2 ドキュメント ガイド ( http://docs.sencha.com/touch/2-1/#!/guide/dataview ) を参照し、それを複製しようとしました。ただし、何らかの理由で、コンテンツを実際にレンダリングできないようです。予想される数の結果が得られており、開示アクションによって正しい/対応するレコードが開かれます。アイテムがすべて空白で、テキストがないだけです。
ストアは、プロキシ経由で JSON データを読み込みます。データには、「キャプション」と呼ばれるフィールドを含む多くのフィールドがあります。今のところ、それがスタイルを設定してリスト項目に表示したいものです。「キャプション」の内容に基づいて、スタイルが異なる場合があります。
いつものように、どんな助けも大歓迎です。ありがとう!
モハマド。
カリフォルニア州サンノゼ
マイ リスト オブジェクト:
Ext.define('qxtapp.view.ResultsList', {
extend: 'Ext.dataview.List',
alias: 'widget.resultsList',
xtype: 'resultsList',
requires: [
'qxtapp.view.ResultsListItem',
'Ext.plugin.ListPaging'
],
config: {
defaultType: 'resultslistitem',
loadingText: 'Performing search...<br>This may take up to 1 minute.',
emptyText: 'No results found.',
useComponents: true,
store: 'SearchResults',
onItemDisclosure: true,
plugins: [
{
xclass: 'Ext.plugin.ListPaging',
autoPaging: true
}
]
}
});
私の ListItem オブジェクト:
Ext.define('qxtapp.view.ResultsListItem', {
extend: 'Ext.dataview.component.ListItem',
xtype : 'resultslistitem',
config: {
captionPanel: true,
dataMap: {
getCaptionPanel: {
setText: 'caption'
}
}
},
applyCaptionPanel: function(config) {
return Ext.factory(config, Ext.Panel, this.getCaptionPanel());
},
updateCaptionPanel: function(newCaptionPanel, oldCaptionPanel) {
if(oldCaptionPanel) {
this.remove(oldCaptionPanel);
}
if(newCaptionPanel) {
this.add(newCaptionPanel);
}
}
});