-
-
Save jacobandresen/02d7351a17e284a0d9aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel='stylesheet' type='text/css' href='../../ext4/resources/css/ext-all.css'/> | |
<script type='text/javascript' src='../../ext4/ext-all-debug.js'></script> | |
<script type='text/javascript' src='7.5_The_Employee_model_with_validations.js'></script> | |
</head> | |
<body> | |
<script type='text/javascript'> | |
//var urlRoot = 'http://extjsinaction.com/crud.php?model=Employee&method='; | |
var urlRoot = 'crud.php?model=Employee&method='; | |
var employeeStore = Ext.create('Ext.data.Store', { | |
model : 'Employee', | |
proxy : { | |
type : 'ajax', | |
api : { | |
create : urlRoot + 'CREATE', | |
read : urlRoot + 'READ', | |
update : urlRoot + 'UPDATE', | |
destroy : urlRoot + 'DESTROY' | |
}, | |
reader : { | |
type : 'json', | |
root : 'data', | |
idProperty : 'id', | |
successProperty : 'meta.success' | |
}, | |
writer : { | |
type : 'json', | |
encode : true, | |
writeAllFields : true, | |
root : 'data', | |
allowSingle : true, | |
batch : false, | |
writeRecords : function(request, data) { | |
request.jsonData = data; | |
return request; | |
} | |
} | |
} | |
}); | |
employeeStore.load(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment