I’m using spring and hibernate to display an extjs chart from database. But, when I’m pointing out the url to the controller, it is not caling . Check my reference in dispatcher servlet
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="index.htm">indexController</prop>
<prop key="loadChart.htm">empCntrl</prop>
</props>
</property>
</bean>
<bean name="empCntrl" class="com.hclt.controllerr.Contrler" />
Script code is as follows:
function loadChart(){
Ext.chart.Chart.CHART_URL = 'images/charts.swf';
var store = new Ext.data.JsonStore({
fields: ['depname', 'count'],
url: 'loadChart.htm'
});
new Ext.Panel({
width: 400,
height: 400,
title: 'Employee Details',
renderTo: 'chartDiv',
items: {
store: store,
xtype: 'piechart',
dataField: 'depname',
categoryField: 'count',
//extra styles get applied to the chart defaults
extraStyle:
{
legend:
{
display: 'top',
padding: 5,
font:
{
family: 'Tahoma',
size: 13
}
}
}
}
});
}
Although you’ve created the store it doesn’t auto-load by default.
either add: autoLoad: true to the config of your store
or
call store.load() somewhere in your function.