我有一个列表,显示一个餐厅列表,其中包含餐厅的标识等.
风景
Ext.define('Test.view.Contacts', {
extend: 'Ext.List',
xtype: 'contacts',
config: {
title: 'Stores',
cls: 'x-contacts',
store: 'Contacts',
itemTpl: [
'<div class="headshot" style="background-image:url(resources/images/logos/{logo});"></div>',
'{name}',
'<span>{add1}</span>'
].join('')
}
});
Run Code Online (Sandbox Code Playgroud)
当您点击餐厅时,我希望它根据点击的项目显示另一个列表.
第二种观点
Ext.define('Test.view.Menu', {
extend: 'Ext.List',
xtype: 'contact-menu',
config: {
title: 'Menu',
cls: 'x-contacts',
store: 'Contacts',
itemTpl: [
'<div>{item}</div>'
].join(''),
},
});
Run Code Online (Sandbox Code Playgroud)
模特
Ext.define('Test.model.Contact', {
extend: 'Ext.data.Model',
config: {
fields: [
'name',
'logo',
'desc',
'telephone',
'city',
'add1',
'post',
'country',
'latitude',
'longitude'
],
proxy: {
type: 'ajax',
url: 'contacts.json'
}
},
hasMany: {
model: "Test.model.Menus", …Run Code Online (Sandbox Code Playgroud) 我正在使用samppipe,看起来很棒,但我想输出JSON.我正在使用Java版本并在NetBeans中进行如下测试:
final URL url = new URL("http://mashable.com/2012/09/26/worlds-best-father-kickstarter-calendar");
System.out.println(ArticleExtractor.INSTANCE.getText(url));
Run Code Online (Sandbox Code Playgroud)
谁能告诉我我是怎么做到的?