-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Excess fields in db #5
Comments
Can i see your exact model ? |
(function(){
/* Database Configurations */
var dbconnval = {
dbName: "EventManager",
dbDescription: "database for EventManager"
};
Ext.DbConnection = new Ext.Sqlite.Connection(dbconnval);
/* Model definition */
Ext.define('eventManager.model.Event', {
extend: 'Ext.data.Model',
idProperty : 'uniqueid',
clientIdProperty : 'id',
config: {
fields: [
{ name: 'id', type: 'string', isTableField: true, fieldOption: 'PRIMARY KEY'},
{ name: 'name', type: 'string', isTableField: true},
{ name: 'startTime', type: 'date', isTableField: true, dateFormat: 'c'},
{ name: 'endTime', type: 'date', isTableField: true, dateFormat: 'c'},
{ name: 'createdBy', type: 'string', isTableField: true},
{ name: 'modId', type: 'int', isTableField: true},
{ name: 'eventType', type: 'string', isTableField: true},
{ name: 'location', type: 'string', isTableField: true},
{ name: 'product', type: 'string', isTableField: true},
{ name: 'objective', type: 'string', isTableField: true},
{ name: 'questionChecked', type: 'boolean', isTableField: true},
{ name: 'question2Checked', type: 'boolean', isTableField: true}
],
hasMany: [
{ model: 'eventManager.model.Cost', name: 'costs'},
{ model: 'eventManager.model.Participant', name: 'participants'}
]
}
});
})(); |
By default all fields in model will be created in table, if you want to avoid any specific fields from table mention like this
|
my bad: files get decorated with extra params when using treedata: Edit: I know the isTableField is supposed to leave out certain fields when set to false. I wanted to use your code and add support for storing treeData. What I didn't knew was when I add 'hasMany' the ST2.0 framework automatically adds those 20extra fields.Those fields didn't have a isTableField set to false so they automatically got added. So it is not an issue, you can close the issue :) I'll keep you posted on my progress! BTW: Nice work! |
I think you can use https://gist.github.com/ to share code |
In the method constructFields you fetch the fields from the model. But not only my model fields got added but these extra fields too:
This resulted in an error when trying to add a column called index...
I temporary solved this by explicitly setting the 'isTableField: true' parameter and removing the part where it could be undefined.
Line 158:
I'm not 100% shure but this proxy doesn't support treedata (yet), am I right? I would like to add that support.
You have any idea how to get the hasMany or hasOne properties out?
I got an Event model the event model hasMany 'cost' and hasMany 'participant'
me.getModel().prototype returns the the model and I see cost and costStore, participant and participantStore but can't find an array containing the child objects (ex: ['cost', 'participant'] ).
The text was updated successfully, but these errors were encountered: