@sourcedream/allcountjs
Version:
The open source framework for rapid business application development with Node.js
25 lines • 691 B
JavaScript
A.app({
appName: "Crud",
menuItems: [
{
name: "Hello world",
entityTypeId: "Foo"
}
],
entities: function(Fields) {
return {
Foo: {
fields: {
foo: Fields.text("Foo"),
bar: Fields.text("Bar")
},
beforeSave: function (Crud, Entity) {
Entity.bar = "Some " + Entity.foo;
},
afterSave: function (Crud, Entity) {
return Crud.crudForEntityType('Foo').updateEntity({id: Entity.id, foo: "Another " + Entity.bar});
}
}
}
}
});