は、ここに私のScrollViewです:カスタムListViewの行、できなくなった行を選択
middle: SC.ScrollView.design({
layout: { top: 36, bottom: 32, left: 0, right: 0 },
backgroundColor: '#ccc',
contentView: SC.ListView.design({
contentBinding: 'Spanish.wordsController.arrangedObjects',
selectionBinding: 'Spanish.wordsController.selection',
contentValueKey: "word",
contentDisplayProperties: 'word english'.w(),
selectOnMouseDown: YES,
exampleView: Spanish.CustomListItemView
})
})
、ここでは私のカスタムリストビューの行です:
Spanish.CustomListItemView = SC.View.extend({
render: function(context, firstTime){
var content = this.get('content');
var word = content.get('word');
var english = content.get('english');
context = context.begin().push(' %@ (%@)'.fmt(word,english)).end();
return sc_super();
}
});
上記の作品は、私はもはやできることを除いて、予想通りビューを選択します。私が "exampleView:Spanish.CustomListItemView"をコメントアウトすると、私は行を選択できますが、もはや適切にフォーマットされていません。 exampleViewを使用しても行を選択できないのはなぜですか?
作品を間違ったクラスをサブクラス化して.ListItemView – LDK