PDA

View Full Version : 'isModel' is null or not an object in Internet Explorer 8



Mahesh Sakunala
25 Feb 2013, 11:01 PM
Hello Guys,

I have used Ext JS 4.1.0 Charts in my dashboard on force.com platform site(Salesforce.com).I've been getting this strange issue only in IE 8 and 7,it works fine on IE 9,10 ,Chrome,Firefox and Safari.

'isModel' is null or not an object

When i've debugged,it was pointing me to the following line in extjs-all.js script file.

createModel:function(a){if(!a.isModel){a=Ext.ModelManager.create(a,this.model)}return a}

I have looked around on forum and other sites for the solution but couldn't get a reliable answer.Can anyone please give me a solution or workaround for this issue?

mitchellsimoens
27 Feb 2013, 11:04 AM
What you have here isn't enough to know the cause of the issue.

Mahesh Sakunala
27 Feb 2013, 1:36 PM
Hello mitchell,

Glad that u've replied to my post.I am attaching my chart code snippet for your reference.Can you please point out where am i going wrong??? :)

Store data is loaded from my Apex Class i have written on force.com platform.



Ext.onReady(function(){
var geographytitle='Report by Geography';

// 'Report by Geography' Chart store


var store = Ext.create('Ext.data.JsonStore', {
fields: ['namegeo', 'datageo'],
data: [
<apex:repeat value="{!grphy}" var="gn">
<apex:repeat value="{!gn}" var="a">
{
'namegeo' : '{!a.geogy}',
'datageo' :{!a.georecords}
},
</apex:repeat>
</apex:repeat>
]
});




// 'Report by Geography' Grid store

var myData1=new Array();


<apex:repeat value="{!indusreport}" var="gn">
<apex:repeat value="{!gn}" var="row">


var rowArray=new Array();
rowArray[0]= '{!row.id}';
var RName ="{!row.AS_id__r.AS_FirstName__c}";
rowArray[1]= RName.replace(/\'/g,'\'');
var NName ="{!row.AS_id__r.AS_LastName__c}";
rowArray[2]= NName.replace(/\'/g,'\'');
var lName ="{!row.AS_id__r.AS_Company__c}";
rowArray[3]= lName.replace(/\'/g,'\'');
var sName ="{!row.AS_id__r.AS_Work_States__c}";
rowArray[4]= sName.replace(/\'/g,'\'');
rowArray[5]= '{!row.AS_id__r.AS_CellPhone__c}';
var eName ="{!row.AS_id__r.AS_Email__c}";
rowArray[6]= eName.replace(/\'/g,'\'');
myData1.push(rowArray);


</apex:repeat>
</apex:repeat>


if(myData1.length<=0)
{
geographytitle=geographytitle+' <span style=\'padding-left:150px\'><font color=\'red\'>No Records Found</font></span>';
tSize=0;
};


var storegrid = new Ext.data.SimpleStore(
{
fields:[{name:'id'},{name:'FirstName'},{name:'LastName'},{name:'AS_id__r.AS_Company__c'},{name:'AS_id__r.AS_Work_States__c'},{name:'AS_id__r.AS_CellPhone__c'},{name:'AS_id__r.AS_Email__c'}],
remoteSort: true,
pageSize: 10,
proxy: {
type: 'pagingmemory',
data: myData1,
reader: {
type: 'array'
}
}
});




Ext.create('Ext.Panel',{
title: geographytitle,
id:'geopanel',
width: 460,
height: 340,
iconCls : 'geo-icon',
closeAction: 'hide',
renderTo: 'geopaneldiv',
layout: 'card',
tbar: [
{
xtype: 'tbspacer',
width: 393
},
{
xtype : 'button',
id:'chartid',
iconCls : 'chart-icon',
layout:'autofit',
handler: function(btn)
{
var panel = Ext.getCmp ('geopanel');
panel.getLayout().setActiveItem ('chartCmp');
}
},
{
xtype:'tbseparator'
},
{
xtype : 'button',
text : null,
id:'gridid',
iconCls : 'grid-icon',
layout: 'autofit',
handler: function(btn)
{
var panel = Ext.getCmp ('geopanel');
panel.getLayout().setActiveItem ('gridpanel');
}
}],
items:
[{
xtype: 'chart',
id: 'chartCmp',
animate: true,
store: store,
layout: 'fit',
legend:
{
position: 'right',
labelFont: '11px Calibri',
spacing : 'absolute'
},
insetPadding: 30,
theme: 'Base:gradients',
series: [{
type: 'pie',
field: 'datageo',
showInLegend: true,
tips: {
trackMouse: true,
width: 230,
height: 25,
renderer: function(storeItem, item)
{
var total = 0;
store.each(function(rec)
{
total += rec.get('datageo');
});
this.setTitle(storeItem.get('namegeo') + ' : ' + storeItem.get('datageo') + ((storeItem.get('datageo')>1 || storeItem.get('datageo')==0)?" Attendees":" Attendee"));
}
},
highlight: {
segment: {
margin: 20
}
},
label: {
field: 'namegeo',
contrast: true,
display:'rotate',
font: '13px Calibri'
}
}]
},
{
xtype:'grid',
layout:'fit',
renderTo: Ext.getBody(),
id:'gridpanel',
store: storegrid,
title: false,
header: false,
bbar: Ext.create('Ext.PagingToolbar', {
pageSize: 10,
store: storegrid,
displayInfo: true
}),
listeners:
{
afterrender: function (component)
{
component.down('#refresh').hide();
}
},
viewConfig:{
loadMask:false
},
columns: [
{header:'id', dataIndex: 'id',hidden:true },
{header: 'Name', dataIndex: 'Name',
renderer: function(value,p,r)
{
return r.data['FirstName']+ ' ' + r.data['LastName'];
}
},
{ header: 'Phone', dataIndex: 'AS_id__r.AS_CellPhone__c' },
{ header: 'E-Mail', dataIndex: 'AS_id__r.AS_Email__c',flex:1.5},
{ header: 'State', dataIndex: 'AS_id__r.AS_Work_States__c',flex:1}
]
}]
});
storegrid.load();

});