Я пишу собственное HTML-приложение, использующее 2.1 Rally SDK. Мои задачи:
- Напишите пользовательское приложение html для разработки иерархической сетки, в которой данные должны
получить от вызова извлечения из Jira Open API.
- Отфильтровать сетку по любому слову
Это мой код:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function () {
Ext.define('User', {
extend: 'Ext.data.Model',
fields: ['FormattedId', 'Name', 'email'],
associations: [
{type: 'hasMany', model: 'UserChild', name: 'UserChild'},
{type: 'hasMany', model: 'Defects', name: 'Defects'},
],
proxy: {
type: 'ajax',
url : './Users.json',
reader: {
type: 'json',
root:'users'
}
},
});
Ext.define("UserChild", {
extend: 'Ext.data.Model',
fields: ['FormattedId', 'Name', 'email'],
belongsTo: 'User'
});
Ext.define("Defects", {
extend: 'Ext.data.Model',
fields: ['FormattedId', 'Name', 'email'],
belongsTo: 'User'
});
var grid=Ext.create('Rally.ui.grid.Grid', {
store: Ext.create('Rally.data.Store', {
model: 'User',
autoLoad:true,
enableHierarchy: true
}),
columnCfgs: [
{
text:'FormattedId' , dataIndex : 'FormattedId'
},
{
text: 'Name', dataIndex: 'Name'
},
{
text:'email' , dataIndex : 'email'
}
]
});
this.add(grid);
}
});
Файл Users.json указан ниже:
{
"users": [
{
"FormattedId": 1,
"Name": "Ed Spencer",
"email": "ed@sencha.com",
"UserChild":{
"FormattedId": 3,
"Name": "Ed Spencer",
"email": "ed@sencha.com"
},
"Defects" :{
"FormattedId": 4,
"Name": "Ed Spencer",
"email": "ed@sencha.com"
}
},
{
"FormattedId": 2,
"Name": "Abe Elias",
"email": "abe@sencha.com",
"UserChild":{
"FormattedId": 5,
"Name": "Ed Spencer",
"email": "ed@sencha.com"
},
"Defects" :{
"FormattedId": 6,
"Name": "Ed Spencer",
"email": "ed@sencha.com"
}
}
]
}
Мне нужна иерархическая сетка с пользовательскими данными, а не хранилище данных ралли.