나는 로컬 스토리지를 사용하여 데이터를 저장할 때 extjs4 MVC에서 작업하고 있는데, 프록시 유형을 ajax에서 localStorage로 동적으로 변경하려고합니다.잡히지 않은 타입 오류 : undefined가 extjs4의 함수가 아닙니까?
localstorage에 데이터를 설정 한 후 오류가 발생했습니다. 유형 불일치 : 유형이 정의되지 않았습니다.
내 모델 :
Ext.define('Am.model.sn.UserModel',{
extend: 'Ext.data.Model',
//idproperty:'userId',//fields property first position pk.
fields: ['userId','firstName','middleName','lastName','languageId','primaryEmail','birthDate','password','securityQuestionId','securityQuestionAnswer','isMale','creationTime','ipAddress','confirmationCode','userStatusId']
});
내 컨트롤러 : 내가 제대로 코드를 이해한다면
Ext.define('Am.controller.sn.UserController1',
{
init:function()
{
console.log('Initialized Users! This happens before the Application launch function is called');
this.control(
{
...
});
},
remeberMe : function()
{
console.log("check box selected");
var email=this.getUserName().getValue();
var password=this.getPassword().getValue();
console.log("email="+email);
var objCheckBox=Ext.getCmp('checkbox');
if(objCheckBox.getValue()==true)
{
window.localStorage.clear();
// Here I am getting error Uncaught TypeError: undefined is not a function
var lsProxy = new Ext.data.proxy.LocalStorage({
id: 'localp',
type:'localstorage',
});
var modelObject = Ext.ModelManager.create(
{
primaryEmail:email,
password: password,
proxy:lsProxy
}, 'Balaee.model.sn.UserModel');
modelObject.setProxy(lsProxy);
modelObject.save();
} else {
console.log("check box is not selected");
}
},
});
나에게주십시오 제안 ...