vaduros
29 Oct 2007, 6:36 AM
I have an editable grid where I need to add new records to the ds. The user will edit the inserted records afterwards and finally save them to the SQL DB.
My problem is that I need to preset two fields of the new record with values from the SQL DB on record creation (before any further editing happens).
The initialization looks like this:
handler : function(){
var pg = new nnote({
ncount: '',
land: '', //this should be set dynamically
fnummer: '', //this should be set dynamically
ausgabe: '',
format: '',
wert: '',
vorschau: '',
hweis: '0|||',
select: true
});
grid.stopEditing();
var ri = nstore.indexOfId(rsm.getSelected().id);
nstore.insert(ri+1, pg);
grid.startEditing(ri+1, 1);
}
I'm not sure about the way to go here to add an update handler for the fields 'fnummer' and 'land': Should I use the UpdateManager and if, how? Or do I have to set up a full separate JsonReader?
If you have some sort of solution, please comment.
My problem is that I need to preset two fields of the new record with values from the SQL DB on record creation (before any further editing happens).
The initialization looks like this:
handler : function(){
var pg = new nnote({
ncount: '',
land: '', //this should be set dynamically
fnummer: '', //this should be set dynamically
ausgabe: '',
format: '',
wert: '',
vorschau: '',
hweis: '0|||',
select: true
});
grid.stopEditing();
var ri = nstore.indexOfId(rsm.getSelected().id);
nstore.insert(ri+1, pg);
grid.startEditing(ri+1, 1);
}
I'm not sure about the way to go here to add an update handler for the fields 'fnummer' and 'land': Should I use the UpdateManager and if, how? Or do I have to set up a full separate JsonReader?
If you have some sort of solution, please comment.