how data in grouping grid will be shown - extjs

I am using this article of architecture http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/
Here is my Application.ResellerGrid.js
Application.ResellerGrid = Ext.extend(Ext.grid.GridPanel, {
border:false
,cityname : ''
,columndataindex : ''
,fromdate:''
,todate : ''
,initComponent:function() {
var config = {
store:new Ext.data.GroupingStore({
// store configs
autoDestroy: true,
autoLoad :false,
url: 'api/index.php?_command=getresellers&city='+this.cityname+'&columndataindex='+this.columndataindex
+'&fromdate='+this.fromdate+'&todate='+this.todate
,
storeId: 'getresellerscount',
// reader configs
root: 'reseller',
idProperty: 'mobile',
fields: [
{name: 'parentname'},
{name: 'firstname'},
{name: 'lastname'},
{name: 'mobile'},
{name: 'email'},
{name: 'tmecode'},
{name: 'tmename'},
{name: 'updatedon'},
{name: 'apptype'},
{name: 'alloctype'},
{name: 'empparent'},
{name: 'irodeferred'}
]
,sortInfo:{field: 'parentname', direction: "ASC"}
,groupField:'parentname'
})
,columns: [
{
id :'parentname',
header : 'Parent Name',
width : 120,
sortable : true,
dataIndex: 'parentname'
},
{
id :'firstname',
header : 'First Name',
width : 120,
sortable : true,
dataIndex: 'firstname'
},
{
id :'lastname',
header : ' Last Name',
width : 100,
sortable : true,
dataIndex: 'lastname'
},
{
id :'mobile',
header : 'Mobile',
height : 50,
width : 100,
sortable : true,
dataIndex: 'mobile'
},
{
id :'email',
header : 'E-Mail',
width : 100,
sortable : true,
dataIndex: 'email'
},
{
id :'tmecode',
header : ' TME Code',
width : 100,
sortable : true,
dataIndex : 'tmecode'
},
{
id :'updatedon',
header : ' updatedon',
width : 100,
sortable : true,
dataIndex: 'updatedon'
},
{
id :'empparent',
header : ' empparent',
width : 100,
sortable : true,
dataIndex: 'empparent'
},
{
id :'alloctype',
header : ' alloctype',
width : 100,
sortable : true,
dataIndex: 'alloctype'
},
{
id :'apptype',
header : ' apptype',
width : 100,
sortable : true,
dataIndex: 'apptype'
}
]
,view: new Ext.grid.GroupingView({
forceFit:true,
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
})
,plugins :[]
,viewConfig :{forceFit:true}
,tbar :[]
,bbar :[]
,height : 250
,width : 860
,title : 'Reseller Grid'
}; // eo config object
// apply config
Ext.apply(this, Ext.apply(this.initialConfig, config));
Application.ResellerGrid.superclass.initComponent.apply(this, arguments);
} // eo function initComponent
,onRender:function() {
this.store.load();
Application.ResellerGrid.superclass.onRender.apply(this, arguments);
} // eo function onRender
});
Ext.reg('ResellerGrid', Application.ResellerGrid);
Here is my json response
{
"reseller": [{
"firstname": "anusha",
"lastname": "",
"mobile": "9739949891",
"email": "",
"tmecode": "010739",
"tmename": "Deepa S",
"updatedon": "2011-03-18 13:17:22",
"apptype": "1",
"alloctype": "2",
"empparent": "Bangalore",
"parentname": "HEMARLI"
}, {
"firstname": "IBRAZ",
"lastname": "",
"mobile": "9740834768",
"email": "",
"tmecode": "010739",
"tmename": "Deepa S",
"updatedon": "2011-03-18 17:52:04",
"apptype": "1",
"alloctype": "2",
"empparent": "Bangalore",
"parentname": "HEMARLI"
}, {
"firstname": "manjunath",
"lastname": "",
"mobile": "7829407211",
"email": "umesthrekha29#yahoo.com",
"tmecode": "012574",
"tmename": "Geetha S",
"updatedon": "2011-03-19 17:12:17",
"apptype": "1",
"alloctype": "2",
"empparent": "Bangalore",
"parentname": "HEMARLI"
}]
}
data in my grid is not showing why ?

Done by adding jsonreader , grouping store doesn't work without jsonreader .

Related

Antd tree table grouped by column value

I need to implement tree table in my react application. that has grouped by an object property value.
The object is as follows
{
"SP": [
{
"DisplayName": "audi",
"Name": "r8",
"Type": "2012"
},
{
"DisplayName": "audi",
"Name": "rs5",
"Type": "2013"
}
],
"Code": [
{
"DisplayName": "ford",
"Name": "mustang",
"Type": "2012"
},
{
"DisplayName": "ford",
"Name": "fusion",
"Type": "2015"
}
],
"Message": [
{
"DisplayName": "kia",
"Name": "optima",
"Type": "2012"
}
]
}
And my table should be as the following image
I have used antd in my project and I tried to implement this functionality with antd table and could not implement as I want. I need the filter functionality too.
Can anyone suggest a solution
You need to restructure your dataSource witch children prop:
function NestedTables() {
return (
<Flexbox>
<Table
size="small"
indentSize={0}
columns={columns}
dataSource={source}
/>
</Flexbox>
);
}
When your source is:
const source = [
{
key: '1',
Code: 'SP',
children: [
{
key: '11',
Code: '5001',
DisplayName: 'audi',
Name: 'r8',
Type: '2012'
},
{
key: '12',
Code: '313',
DisplayName: 'audi',
Name: 'rs5',
Type: '2013'
}
]
},
{
key: '2',
Code: 'Code',
children: [
{
key: '21',
Code: '243',
DisplayName: 'ford',
Name: 'mustang',
Type: '2012'
},
{
key: '22',
Code: '503431',
DisplayName: 'ford',
Name: 'fusion',
Type: '2015'
}
]
},
{
key: '3',
Code: 'Message',
children: [
{
key: '31',
Code: '4311',
DisplayName: 'kia',
Name: 'optima',
Type: '2012'
}
]
}
];
And defined columns filters:
const columns = [
{
title: 'Code',
dataIndex: 'Code',
key: 'Code',
filters: [
{ text: 'SP', value: 'SP' },
{ text: 'Code', value: 'Code' },
{ text: 'Message', value: 'Message' }
],
onFilter: (value, record) => record.Code.indexOf(value) === 0
},
{
title: 'Display Name',
dataIndex: 'DisplayName',
key: 'DisplayName',
filters: [
{ text: 'audi', value: 'audi' },
{ text: 'ford', value: 'ford' },
{ text: 'kia', value: 'kia' }
],
onFilter: (value, record) =>
record.children.filter(child => child.DisplayName === value).length > 0
},
{ title: 'Name', dataIndex: 'Name', key: 'Name' },
{ title: 'Type', dataIndex: 'Type', key: 'Type' }
];
Demo:

dojo combo box select state full name but display state code

Here is what I want to achieve - display state code when selecting a state full name. https://dojotoolkit.org/documentation/tutorials/1.10/selects_using_stores/demos/ProgFilteringSelect.html
But why I couldn't make it work? Here are the dojo codes and the state.json file.
dojo.xhrGet({url: datapath,
handleAs: dataformat,
load: function (result) {
require([
'dojo/store/Memory',
'dijit/form/ComboBox',
'dojo/domReady!'
], function (Memory, ComboBox) {
stateStore = new Memory({
idProperty: "code",
data: result.states.sort(function(a,b) {
var x = a.name.toLowerCase();
var y = b.name.toLowerCase();
return x < y ? -1 : x > y ? 1 : 0;
})
});
var cboState = new ComboBox({
id: 'usastate',
name: 'usastate',
style:{width: '100%', height: '35px', fontSize: '30px'},
placeholder: 'Select a State',
store: stateStore,
searchAttr: 'name',
autocomplete: true,
onChange: function(value) {
dom.byId('statecode').innerHTML = value;
}
});
cboState.placeAt(dom.byId('state')).startup();
});
}
});
"states": [
{
"name": "Alabama",
"abbreviation": "AL",
"code": "01"
},
{
"name": "Alaska",
"abbreviation": "AK",
"code": "02"
},
{
"name": "Arizona",
"abbreviation": "AZ",
"code": "03"
},
{
"name": "Arkansas",
"abbreviation": "AR",
"code": "04"
}
FilteringSelect worked. Not sure why Combo Box doesn't support it.
var cboState = new FilteringSelect({
id: 'usastate',
name: 'usastate',
style:{width: '100%', height: '35px', fontSize: '30px'},
placeholder: 'Select a State',
store: stateStore,
searchAttr: 'name',
autocomplete: true,
onChange: function(value) {
dom.byId("statecode").innerHTML = value;
dom.byId("statename").innerHTML = this.get("displayedValue");
}
});
You are setting the value of the HTML input element which should not be done here. Set the displayedValue attribute of the ComboBox in your onChange function.
var cboState = new ComboBox({
id: 'usastate',
name: 'usastate',
style:{width: '100%', height: '35px', fontSize: '30px'},
placeholder: 'Select a State',
store: stateStore,
searchAttr: 'name',
autocomplete: true,
onChange: function(value) {
this.set('displayedValue', value);
}
});

Extjs 4.1.1: Grid to Tree drag drop not working

I want to achieve something like this :
http://jsfiddle.net/mgill21/3HJXX/2/
But I whenever I drop a node from grid into the treecolumn (as a leaf node) I get errors such as node.updateInfo() is undefined and other node related undefined method.
Here is my code:
Ext.namespace('Ext.ux.window.ConfigureMobileApp');
Ext.require([ 'Ext.grid.*', 'Ext.data.*', 'Ext.dd.*' ]);
var firstGridStore = Ext.create('Ext.data.Store', {
storeId : 'formStore',
fields : [ 'name', 'type', 'itemId' ],
data : [ {
name : "Michael Scott",
itemId : 7,
type : "Management"
}, {
name : "Dwight Schrute",
itemId : 2,
type : "Sales"
}, {
name : "Jim Halpert",
itemId : 3,
type : "Sales"
}, {
name : "Kevin Malone",
itemId : 4,
type : "Accounting"
}, {
name : "Angela Martin",
itemId : 5,
type : "Accounting"
} ]
});
// declare the source Grid
var firstGrid = Ext.create('Ext.grid.Panel', {
viewConfig : {
plugins : {
ptype : 'gridviewdragdrop',
ddGroup : 'selDD'
}
},
store : Ext.data.StoreManager.lookup('formStore'),
columns : [ {
text : "Name",
flex : 1,
sortable : true,
dataIndex : 'name'
}, {
text : "Type",
width : 70,
sortable : true,
dataIndex : 'type'
} ],
stripeRows : true,
title : 'First Grid',
margins : '0 2 0 0',
width : 200
});
Ext.define('Resource', {
extend : 'Ext.data.Model',
fields : [ {
name : "name",
type : "string"
}, {
name : "type",
type : "string"
} ]
});
var store1 = Ext.create('Ext.data.TreeStore', {
storeId : 'treeStore',
fields : [ 'name', 'type', 'itemId' ],
root : {
expanded : true,
children : [ {
itemId : 171,
type : "comedy",
name : "Mr Bean",
children : [ {
leaf : true,
itemId : 171,
type : "actor",
name : "Rowan Atkinson"
} ],
}, {
itemId : 11,
type : "fantasy",
name : "Harry Potter",
children : [ {
itemId : 11,
leaf : true,
type : "actress",
name : "Emma Watson",
} ]
}, {
itemId : 173,
type : "Action",
name : "Fast and Furious",
children : [ {
itemId : 174,
type : "actor",
name : "Dwayne Johnson",
children : [ {
leaf : true,
itemId : 175,
type : "wrestler",
name : "The Rock"
} ]
} ]
} ]
}
});
Ext.define('Ext.ux.window.TreeGrid', {
extend : 'Ext.tree.Panel',
title : 'Demo',
height : 300,
rootVisible : true,
singleExpand : true,
store : Ext.data.StoreManager.lookup('treeStore'),
columns : [ {
xtype : 'treecolumn',
text : 'Name',
dataIndex : 'name',
width : 200
}, {
text : 'Type',
dataIndex : 'type'
} ],
initComponent : function() {
this.callParent();
},
viewConfig : {
plugins : {
ptype : 'treeviewdragdrop',
ddGroup : 'selDD'
},
listeners : {
beforedrop : function(node, data) {
debugger;
data.records[0].set('leaf', true);
data.records[0].set('expanded', false);
data.records[0].set('checked', true);
},
drop : function(node, data, dropRec, dropPosition) {
// firstGridStore.store.remove(data.records[0]);
}
}
}
});
var secondTree = Ext.create('Ext.ux.window.TreeGrid');
Ext.define('Ext.ux.window.ConfigureMobileApp', {
extend : 'Ext.window.Window',
title : 'Configure Mobile App',
height : 600,
width : 600,
layout : 'hbox',
modal : true,
closeAction : 'hide',
items : [ firstGrid, secondTree ]
});
Please help. Stuck since a very long time.
To help u out with this error i m sending u two links .These are not the proper solution but will surely guide u a way for that.
First Link
Second Link

How to customise extjs remote extensible calendar example with MVC application?

I have downloaded 'extensible-1.6.0-b1', I'm trying to understand the remote example to customise it with my application. I'm coding with extjs 4.0.7.
I want to know how to intgrate the example in mvc application? Is there an example with clear architecture: store+model+controller?
Edit:
This is the code I'm using now:
Ext.define('Webdesktop.view.calendar.Calendar', {
extend : 'Ext.tab.Panel',
alias : 'widget.calendar_calendar',
//autoShow : true,
paths: {
'Extensible': 'extensible-1.6.0-b1/src',
'Extensible.example': 'extensible-1.6.0-b1/examples'
},
requires:([
'Ext.Viewport',
'Ext.layout.container.Border',
'Ext.data.proxy.Rest',
'Extensible.calendar.data.MemoryCalendarStore',
'Extensible.calendar.data.EventStore',
'Extensible.calendar.CalendarPanel'
]),
initComponent: function() {
var me = this;
var calendarStore = Ext.create('Extensible.calendar.data.MemoryCalendarStore', {
autoLoad: true,
proxy: {
type: 'ajax',
url: 'app/data/calendars.json',
noCache: false,
reader: {
type: 'json',
root: 'calendars'
}
}
});
var eventStore = new Ext.data.JsonStore({
autoLoad: true,
fields: [
{name: 'EventId', mapping:'id', type:'int'},
{name: 'CalendarId', mapping: 'cid', type: 'int'},
{name: 'Title', mapping: 'title'},
{name: 'StartDate', mapping: 'start', type: 'date', dateFormat: 'c'},
{name: 'EndDate', mapping: 'end', type: 'date', dateFormat: 'c'}
],
proxy : {
type : 'ajax',
api : {
read : GLOBAL_USER_PROFILE.apiUrl + '_module/calendar/_action/loadEvent'
},
extraParams : {
_module : 'calendar',
_action : 'loadEvent',
_db : '2d3964b9...e53a82'
},
reader : {
type : 'json',
root : 'evts'
},
writer : {
type : 'json',
encode : true
}
},
listeners: {
'write': function(store, operation){
var title = Ext.value(operation.records[0].data[Extensible.calendar.data.EventMappings.Title.name], '(No title)');
switch(operation.action){
case 'create':
Extensible.example.msg('Add', 'Added "' + title + '"');
break;
case 'update':
Extensible.example.msg('Update', 'Updated "' + title + '"');
break;
case 'destroy':
Extensible.example.msg('Delete', 'Deleted "' + title + '"');
break;
}
}
}
});
var cp = Ext.create('Extensible.calendar.CalendarPanel', {
id: 'calendar-remote',
region: 'center',
eventStore: eventStore,
calendarStore: calendarStore,
title: 'Remote Calendar'
});
Ext.apply(me, {
items : {
xtype : 'panel',
activeItem : 0,
layout: {
type: 'fit'
},
border : false, //FIXME: see class comment, bug
defaults : {
closable : false, //FIXME: see class comment, bug
border : false //FIXME: see class comment, bug
},
title : 'الاستقبال',
closable : true,
bodyPadding : 0,
items: [
cp
]
}
});
me.callParent();
}
});
The json returned:
{
"evts":[{
"EventId":"1",
"CalendarId":"0",
"Title":"$data",
"StartDate":"Mon May 13 2013 09:21:57 GMT+0100",
"EndDate":"Mon May 13 2013 09:21:57 GMT+0100",
"Duration":"0",
"Location":"",
"Notes":"",
"Url":"",
"IsAllDay":"0",
"Reminder":""
},{
"EventId":"2",
"CalendarId":"0",
"Title":"$data",
"StartDate":"Mon May 13 2013 09:21:57 GMT+0100",
"EndDate":"Mon May 13 2013 09:21:57 GMT+0100",
"Duration":"0",
"Location":"",
"Notes":"",
"Url":"",
"IsAllDay":"0",
"Reminder":""
}]
}
But events are not displayed in the calendar, and I have this error in Firebug:
TypeError: data[M.StartDate.name] is null
I had the same problem i just solved it yesterday, it's about the format of your date that's incorrect take this may that help you :
so this is my view :
Ext.define('Congectis.view.CalendarTry', {
extend: 'Ext.panel.Panel',
alias: 'widget.calendartry',
requires: [
'Ext.data.proxy.Rest',
'Extensible.calendar.data.MemoryCalendarStore',
'Extensible.calendar.CalendarPanel',
'Extensible.calendar.data.EventStore'
],
autoShow: true,
layout: 'fit',
Store: ['Evts'],
initComponent: function () {
var calendarStore = Ext.create('Extensible.calendar.data.MemoryCalendarStore', {
autoLoad: true,
proxy: {
type: 'ajax',
url: '../../../../../MVC/eLeave/data/event2.json',
noCache: false,
reader: {
type: 'json',
root: 'calendars'
}
}
});
var eventstore = Ext.create('Extensible.calendar.data.EventStore', {
autoLoad: true,
fields: [
{name: 'EventId', mapping: 'EventId', type: 'int'},
{name: 'CalendarId', mapping: 'CalendarId', type: 'int'},
{name: 'Title', mapping: 'Title'},
{name: 'StartDate', mapping: 'StartDate', type: 'date', dateFormat: 'm-d-Y'},
{name: 'EndDate', mapping: 'EndDate', type: 'date', dateFormat: 'm-d-Y'}
],
proxy: {
type: 'ajax',
url: '../../../../../MVC/eLeave/data/event1.json',
noCache: false,
reader: {
type: 'json',
root: 'data'
},
writer: {
type: 'json',
nameProperty: 'mapping'
},
listeners: {
exception: function (proxy, response, operation, options) {
var msg = response.message ? response.message : Ext.decode(response.responseText).message;
Ext.Msg.alert('Server Error', msg);
}
}
},
//option for generically messaging after CRUD persistence has succeeded.
listeners: {
'write': function (store, operation) {
var title = Ext.value(operation.records[0].data[Extensible.calendar.data.EventMappings.Title.name], '(No title)');
switch (operation.action) {
case 'create':
Extensible.example.msg('Add', 'Added "' + title + '"');
break;
case'update':
Extensible.example.msg('Update', 'Updated "' + title + '"');
break;
case'destroy':
Extensible.example.msg('Delete', 'Deleted "' + title + '"');
break;
}
}
}
});
this.items = [{
xtype: 'extensible.calendarpanel',
eventStore: eventstore,
calendarStore: calendarStore,
title: 'Calendrier des conges',
name: 'eLeave-calendar',
height: 500,
width: 500
}];
//Extensible.calendar.data.CalendarModel.reconfigure();
this.callParent(arguments);
}
});
This is my json store
{
"success": true,
"message": "Loaded data",
"data": [{
"id": 1001,
"cid": 1,
"start": "2015-03-18T10:00:00-07:00",
"end": "2015-03-28T15:00:00-07:00",
"title": "Vacation",
"notes": "Have fun"
}, {
"id": 1002,
"cid": 2,
"start": "2015-04-07T11:30:00-07:00",
"end": "2015-04-07T13:00:00-07:00",
"title": "Lunch with Matt",
"loc": "Chuy's",
"url": "http:\/\/chuys.com",
"notes": "Order the queso"
}, {
"id": 1003,
"cid": 3,
"start": "2015-04-07T15:00:00-07:00",
"end": "2015-04-07T15:00:00-07:00",
"title": "Project due"
}, {
"id": 1004,
"cid": 1,
"start": "2015-04-07T00:00:00-07:00",
"end": "2015-04-07T00:00:00-07:00",
"title": "Sarah's birthday",
"ad": true,
"notes": "Need to get a gift"
}, {
"id": 1005,
"cid": 2,
"start": "2015-03-26T00:00:00-07:00",
"end": "2015-04-16T23:59:59-07:00",
"title": "A long one...",
"ad": true
}, {
"id": 1006,
"cid": 3,
"start": "2015-04-12T00:00:00-07:00",
"end": "2015-04-13T23:59:59-07:00",
"title": "School holiday"
}, {
"id": 1007,
"cid": 1,
"start": "2015-04-07T09:00:00-07:00",
"end": "2015-04-07T09:30:00-07:00",
"title": "Haircut",
"notes": "Get cash on the way",
"rem": 60
}, {
"id": 1008,
"cid": 3,
"start": "2015-03-08T00:00:00-08:00",
"end": "2015-03-10T00:00:00-07:00",
"title": "An old event",
"ad": true
}, {
"id": 1009,
"cid": 2,
"start": "2015-04-05T13:00:00-07:00",
"end": "2015-04-05T18:00:00-07:00",
"title": "Board meeting",
"loc": "ABC Inc.",
"rem": 60
}, {
"id": 1010,
"cid": 3,
"start": "2015-04-05T00:00:00-07:00",
"end": "2015-04-09T23:59:59-07:00",
"title": "Jenny's final exams",
"ad": true
}, {
"id": 1011,
"cid": 1,
"start": "2015-04-09T19:00:00-07:00",
"end": "2015-04-09T23:00:00-07:00",
"title": "Movie night",
"note": "Don't forget the tickets!",
"rem": 60
}]
}
The problem was with your date format, wish that helped you, good luck
`

How do i reference complex json objects in my model so they can be displayed in a list

Im trying to reference complex json object in my model and then display them in a table along with the other object. Below is a an example of the json. How do get to rating and type?
"reviews" : [
{
"aspects" : [
{
"rating" : 1,
"type" : "food"
},
{
"rating" : 3,
"type" : "decor"
},
{
"rating" : 2,
"type" : "service"
}
]
Ext.define('FirstApp.model.Details',{
extend:'Ext.data.Model',
config:{
// fields: ['id','recordId','name','icon','vicinity','reference','website','reviews.aspects.type'],
fields: [ {
name: 'aspects',
mapping: 'reviews.aspects'
},
{
name: 'vicinity'
},
{
name: 'name'
},
{
name: 'icon'
},
{
name: 'website'
}]
}
})
I am calling the table below but i am getting the error Uncaught SyntaxError: Unexpected token ILLEGAL where the itemTpl is.
{
xtype:'list',
store:'Details',
itemTpl:'<img src="{icon}"></img><h1>{name:ellipsis(25)}</h1>
<h3>{vicinity:ellipsis(35)}</h3><h2>{website}</2><h2>{reviews}</h2><tpl for="aspects">
{rating} - {type}
</tpl>',
itemCls:'place-entry'
}
Note:
I have tried the following. The errors have stopped and all the other information is displayed but the aspect are still a no show.
itemTpl:new Ext.XTemplate(
'<div>',
'<div><img src="{icon}"></img><br>',
'<h1>{name}</1><br>',
' </div>',
'<div><h3>{vicinity:ellipsis(60)}</h3><h3>{website}</3><br>',
'<h3>{formatted_phone_number}</h3><br>',
'<tpl for="aspects"<td>{type}</td></tpl><br>',
' </div>',
'</div>'
),
And this is now how the model looks:
fields: [
{
name: 'reviews'
},
{
name: 'aspects',
mapping: 'reviews.aspects'
},
{
name: 'vicinity'
},
{
name: 'name'
},
{
name: 'icon'
},
{
name: 'website'
},
{
name: 'formatted_phone_number'}]
}
Sample Data:
"reviews" : [
{
"aspects" : [
{
"rating" : 3,
"type" : "food"
},
{
"rating" : 3,
"type" : "decor"
},
{
"rating" : 3,
"type" : "service"
}
],
"author_name" : "Aubrey Skelly",
"author_url" : "https://plus.google.com/101776084849290882399",
"text" : "Small and wonderful, the food fantastic, service 100% miss this wonderful restaurant and you will miss a gem in waterford",
"time" : 1359588944
},
I think you have to map in the model:
fields: [
{
name: 'aspects',
mapping: 'reviews.aspects'
},
{
name: 'vicinity'
}
...
Then in tpl:
<tpl for="aspects">
{rating} - {type}
</tpl>
Note:
You can not have line breaks in the tpl:
//this will throw an error
itemTpl: '<div>this is some content<br>
this is the same div but I am on a new line now</div>'
You have to split the lines:
//this is OK
itemTpl: '<div>this is some content<br>',
'this is the same div but I am on a new line now</div>'

Resources