PDA

View Full Version : How to update Dataview after (re)load store



pcr
19 Jan 2011, 7:11 AM
In my app I display a Dataview with data from Database. After tap an item the user is asked to fill out a form.
Submit the form the tapped record in the Database is updated.

Finally I want is to see these updates in the Dataview.

I tried to (re)load store: view.store.load(); In my debug console I see the store receives data from Database. But for some reason this doesn't update the Dataview??

I tried: view.store.on('load', view.store.refresh()). Doesn't work!

After I restart the entire app all updates are OK!!

Did I oversee something here.

Here is the code I use:



/*
*/

fmis.servicedesk = function(profielid, uitvoerendeid) {
//
// Get store with serverside filtered (filter op profiel)
// Load main store
//
var servincidentStore = new Ext.data.Store({
model: 'Incident',
storeId: 'incident',
pageSize: 9999,
proxy: {
type: 'ajax',
url: '/generator-grid/BackendGrid/incidentGridBackend.php',
extraParams: {
start: 0,
limit: 9999,
userProfielId: profielid,
task: 'LISTING',
xvelden: ', incident.PersoonId ',
sort: 'incident.Incident',
dir: 'ASC'
},
reader: {
type: 'json',
root: 'results'
}
}
});
servincidentStore.load();
//
// Load some lookupstores
//
var servpandStore = new Ext.data.Store({
model: 'Pand',
storeId: 'pand',
pageSize: 9999,
proxy: {
type: 'ajax',
url: '/generator-grid/BackendCombo/pandcombo.php',
extraParams: {
start: 0,
limit: 9999,
userProfielId: profielid,
task: 'LISTING',
sort: 'pand.Pand',
dir: 'ASC'
},
reader: {
type: 'json',
root: 'results'
}
}
});
servpandStore.load();

var servverdiepingStore = new Ext.data.Store({
model: 'Verdieping',
storeId: 'verdieping',
pageSize: 9999,
proxy: {
type: 'ajax',
url: '/generator-grid/BackendGrid/verdiepingGridBackend.php',
extraParams: {
start: 0,
limit: 9999,
userProfielId: profielid,
task: 'LISTING',
velden: 'verdieping.Id, verdieping.Verdieping, verdieping.PandId',
sort: 'verdieping.Verdieping',
dir: 'ASC'
},
reader: {
type: 'json',
root: 'results'
}
}
});
servverdiepingStore.load();

var servruimteStore = new Ext.data.Store({
model: 'Ruimte',
storeId: 'ruimte',
pageSize: 9999,
proxy: {
type: 'ajax',
url: '/generator-grid/BackendGrid/ruimteGridBackend.php',
extraParams: {
start: 0,
limit: 9999,
userProfielId: profielid,
task: 'LISTING',
filterTxt1: 'RuimtesoortId',
filterValue1: '4',
velden: 'ruimte.Id, ruimte.Ruimte, ruimte.LocatieverdiepingIdVerdieping',
sort: 'ruimte.Ruimte',
dir: 'ASC'
},
reader: {
type: 'json',
root: 'results'
}
}
});
servruimteStore.load();

var servincidentsoortStore = new Ext.data.Store({
model: 'Incidentsoort',
storeId: 'incidentsoort',
pageSize: 9999,
proxy: {
type: 'ajax',
url: '/generator-grid/BackendCombo/incidentsoortcombo.php',
extraParams: {
start: 0,
limit: 9999,
userProfielId: profielid,
task: 'LISTING',
sort: 'incidentsoort.Incidentsoort',
dir: 'ASC'
},
reader: {
type: 'json',
root: 'results'
}
}
});
servincidentsoortStore.load();

var servproductclusterStore = new Ext.data.Store({
model: 'Productcluster',
storeId: 'productcluster',
pageSize: 9999,
proxy: {
type: 'ajax',
url: '/generator-grid/BackendCombo/productclustercombo.php',
extraParams: {
start: 0,
limit: 9999,
userProfielId: profielid,
task: 'LISTING',
sort: 'productcluster.Productcluster',
dir: 'ASC'
},
reader: {
type: 'json',
root: 'results'
}
}
});
servproductclusterStore.load();

var servproductStore = new Ext.data.Store({
model: 'Product',
storeId: 'product',
pageSize: 9999,
proxy: {
type: 'ajax',
url: '/generator-grid/BackendGrid/productGridBackend.php',
extraParams: {
start: 0,
limit: 9999,
userProfielId: profielid,
velden: 'product.Id, product.Product, productcluster.Id AS ProductclusterId, productcluster.Productcluster',
task: 'LISTING',
sort: 'product.Product',
dir: 'ASC'
},
reader: {
type: 'json',
root: 'results'
}
}
});
servproductStore.load();

var servuitvoerendeStore = new Ext.data.Store({
model: 'Uitvoerende',
storeId: 'uitvoerende',
pageSize: 9999,
proxy: {
type: 'ajax',
url: '/generator-grid/BackendCombo/uitvoerendecombo.php',
extraParams: {
start: 0,
limit: 9999,
userProfielId: profielid,
task: 'LISTING',
sort: 'uitvoerende.Uitvoerende',
dir: 'ASC'
},
reader: {
type: 'json',
root: 'results'
}
}
});
servuitvoerendeStore.load();

var servdoorlooptijdStore = new Ext.data.Store({
model: 'Doorlooptijd',
storeId: 'doorlooptijd',
pageSize: 9999,
proxy: {
type: 'ajax',
url: '/generator-grid/BackendCombo/doorlooptijdcombo.php',
extraParams: {
start: 0,
limit: 9999,
userProfielId: profielid,
task: 'LISTING',
sort: 'doorlooptijd.Doorlooptijd',
dir: 'ASC'
},
reader: {
type: 'json',
root: 'results'
}
}
});
servdoorlooptijdStore.load();

//
// Filter on main store to simulate store empty
// Create Dataview based on main store 'incident'
// Deze filter maakt de store leeg
//
servincidentStore.clearFilter();
servincidentStore.filter('Incidentstatus', 'none');
fmis.incidentnieuw = new Ext.DataView({
store: 'incident',
id: 'Nieuw',
tpl: fmis.incidentTpl,
multiSelect: true,
overItemCls:'x-view-over',
itemSelector: 'div.myIncident',
listeners: {
itemtap: myIncident,
scope: this
},
emptyText: 'Geen nieuwe incidenten gevonden'
});

fmis.incidentinbehandeling = new Ext.DataView({
store: 'incident',
id: 'In Behandeling',
tpl: fmis.incidentTpl,
multiSelect: true,
overItemCls:'x-view-over',
itemSelector: 'div.myIncident',
listeners: {
itemtap: myIncident,
scope: this
},
emptyText: 'Geen incidenten in behandeling gevonden'
});

fmis.incidentuitvoering = new Ext.DataView({
store: 'incident',
id: 'Uitvoering',
tpl: fmis.incidentTpl,
multiSelect: true,
overItemCls:'x-view-over',
itemSelector: 'div.myIncident',
listeners: {
itemtap: myIncident,
scope: this
},
emptyText: 'Geen incidenten uitvoering gevonden'
});

fmis.incidentopgelost = new Ext.DataView({
deferEmptyText: true,
id: 'Opgelost',
store: 'incident',
tpl: fmis.incidentTpl,
multiSelect: true,
overItemCls:'x-view-over',
itemSelector: 'div.myIncident',
listeners: {
itemtap: myIncident,
scope: this
},
emptyText: 'Geen opgeloste incidenten gevonden'
});

fmis.incidentnietopgelost = new Ext.DataView({
deferEmptyText: true,
id: 'Niet Opgelost',
store: 'incident',
tpl: fmis.incidentTpl,
multiSelect: true,
overItemCls:'x-view-over',
itemSelector: 'div.myIncident',
listeners: {
itemtap: myIncident,
scope: this
},
emptyText: 'Geen niet opgeloste incidenten gevonden'
});

fmis.incidentgesloten = new Ext.DataView({
deferEmptyText: true,
id: 'Gesloten',
store: 'incident',
tpl: fmis.incidentTpl,
multiSelect: true,
overItemCls:'x-view-over',
itemSelector: 'div.myIncident',
listeners: {
itemtap: myIncident,
scope: this
},
emptyText: 'Geen gesloten incidenten gevonden'
});

fmis.incidentarchief = new Ext.DataView({
deferEmptyText: true,
id: 'Archief',
store: 'incident',
tpl: fmis.incidentTpl,
multiSelect: true,
overItemCls:'x-view-over',
itemSelector: 'div.myIncident',
listeners: {
itemtap: myIncident,
scope: this
},
emptyText: 'Geen incidenten in archief gevonden'
});
//
// Last Dataview contains all records in main store
//
servincidentStore.clearFilter();
fmis.incidentall = new Ext.DataView({
store: 'incident',
id: 'All',
tpl: fmis.incidentTpl,
multiSelect: true,
overItemCls:'x-view-over',
itemSelector: 'div.myIncident',
listeners: {
itemtap: myIncident,
scope: this
},
emptyText: 'Geen incidenten gevonden'
});
//
// Remove Carousel if allready exist.
//
if(fmis.serv) {
fmis.serv.destroy();
}

fmis.serv = new Ext.Carousel({
id: 'Carousel',
items: [fmis.incidentall, fmis.incidentnieuw, fmis.incidentinbehandeling, fmis.incidentuitvoering, fmis.incidentopgelost, fmis.incidentnietopgelost, fmis.incidentgesloten, fmis.incidentarchief]
});

fmis.serv.on('beforecardswitch', onBeforeCardSwitch, this);

function onBeforeCardSwitch(dummy, newCard, oldCard, index, animated) {
//
// switch to another card
// set filter for new card
// set header in navigationbar
//
servincidentStore.clearFilter();
if(newCard.getId() !== 'All') {
servincidentStore.filter('Incidentstatus', newCard.getId());
fmis.Main.ui.navigationBar.setTitle('Incidenten ' + newCard.getId() + '(' + servincidentStore.getCount() + ')');
} else {
fmis.Main.ui.navigationBar.setTitle('Incidenten Alles (' + servincidentStore.getCount() + ')');
}
fmis.Main.ui.navigationBar.doComponentLayout();
}
//
// Item tapped in a Dataview
//
function myIncident(view, index, item, e) {
var rec = view.store.getAt(index);
var incidentid = rec.get('Id');
var incident = rec.get('Incident');
fmis.FormIncidentstatus = {
init: function() {
//
// Nieuw incidenten moeten uitvoerig behandeld worden
//
if(view.id == 'Nieuw') {
var formBase = {
url: 'generator-grid/BackendGrid/incidentGridBackend.php',
standardSubmit : false,
items: [{
xtype: 'fieldset',
title: 'Wijzig Incident status (Nieuw) ' + incident,
instructions: 'Wijzig status. Schrijf evt een toelichting.',
defaults: {
labelAlign: 'left',
labelWidth: '35%'
},
items: [{
xtype: 'textfield',
name : 'Toelichtingnieuw',
label: 'Toelichting'
}, {
xtype: 'checkboxfield',
required: true,
name : 'Spoed',
label: 'Spoed',
value: '0',
options: [
{text: 'Nee', value: '0'},
{text: 'Ja', value: '1'}
]
}, {
xtype: 'selectfield',
required: true,
name : 'PandId',
id: 'PandId',
valueField: 'Id',
displayField: 'Pand',
store: 'pand',
listeners:{
change:{
fn:function(combo, value) {
//
// Clear next 2 fields in form
//
var verdiepingCmp = Ext.getCmp('VerdiepingselectfieldId');
verdiepingCmp.setValue(' ');
var ruimteCmp = Ext.getCmp('RuimteselectfieldId');
ruimteCmp.setValue(' ');
//
// Filter store based on select here
//
servverdiepingStore.clearFilter();
servverdiepingStore.filter('PandId', combo.getValue());
//
// WORKAROUND for bug in Sencha-touch. Not autofill panel with selections only once
//
verdiepingCmp.getListPanel().setHeight(servverdiepingStore.getCount() * 48);
}
}
},
label: 'Pand'
}, {
xtype: 'selectfield',
required: true,
name : 'VerdiepingId',
id: 'VerdiepingselectfieldId',
valueField: 'Id',
displayField: 'Verdieping',
store: 'verdieping',
listeners:{
change:{
fn:function(combo, value) {
var ruimteCmp = Ext.getCmp('RuimteselectfieldId');
ruimteCmp.setValue(' ');
servruimteStore.clearFilter();
servruimteStore.filter('LocatieverdiepingIdVerdieping', combo.getValue());
ruimteCmp.getListPanel().setHeight(servruimteStore.getCount() * 48);
selectedverdieping = this.store.getAt(this.store.find('Id',this.value)).get('Verdieping');
}
}
},
label: 'Verdieping'
}, {
xtype: 'selectfield',
required: true,
name : 'LocatieruimteIdRuimte',
id : 'RuimteselectfieldId',
valueField: 'Id',
displayField: 'Ruimte',
store: 'ruimte',
label: 'Ruimte'
}, {
xtype: 'selectfield',
required: true,
name : 'UitvoerendeId',
valueField: 'Id',
displayField: 'Uitvoerende',
store: 'uitvoerende',
label: 'Uitvoerende'
}, {
xtype: 'selectfield',
required: true,
name : 'IncidentsoortId',
valueField: 'Id',
displayField: 'Incidentsoort',
store: 'incidentsoort',
label: 'Soort'
}, {
xtype: 'selectfield',
required: true,
id: 'ProductclusterselectfieldId',
name : 'ProductclusterId',
valueField: 'Id',
displayField: 'Productcluster',
store: 'productcluster',
listeners:{
change:{
fn:function(combo, value) {
var productCmp = Ext.getCmp('ProductselectfieldId');
productCmp.setValue(' ');
servproductStore.clearFilter();
servproductStore.filter('ProductclusterId', combo.getValue());
productCmp.getListPanel().setHeight(servproductStore.getCount() * 48);
}
}
},
label: 'Productcluster'
}, {
xtype: 'selectfield',
required: true,
id: 'ProductselectfieldId',
name : 'ProductId',
valueField: 'Id',
displayField: 'Product',
store: 'product',
label: 'Product'
}, {
xtype: 'selectfield',
required: true,
name : 'DoorlooptijdId',
valueField: 'Id',
displayField: 'Doorlooptijd',
store: 'doorlooptijd',
label: 'Doorlooptijd'
}, {
xtype: 'selectfield',
required: true,
id: 'IncidentstatusNieuw',
name : 'IncidentstatusId',
label: 'Nieuwe status',
options: [
{text: 'In Behandeling', value: '3'},
{text: 'Niet Opgelost', value: '6'}
]
}]
}],
listeners : {
submit : function(form, result){
//
// Submit has updated this record in Database on server
//
//
// Update field in store. This field determine on wicht card in carousel this record belongs.
//
var incidentstatusid = incidentstatus[Ext.getCmp('IncidentstatusNieuw').getValue()];
rec.set('Incidentstatus', incidentstatusid);
//
// Remove form
//
form.destroy();
//
// Update the actual card in Carousel. Current record will be removed because of updated field in store
//
//
view.store.clearFilter();
view.store.filter('Incidentstatus', 'Nieuw');
view.store.load();
view.refresh();
//
// Update header in navigationBar with new number of filtered records
//
fmis.Main.ui.navigationBar.setTitle('Incidenten In Nieuwwww (' + view.store.getCount() + ')');
fmis.Main.ui.navigationBar.doComponentLayout();
/*
So far so good. Problem: On the server this record has more updates (with some processing on server)
than the field above.
Record is moved to next card in Carousel correctly
but no other fields in record are updated.
How do I this record in sync with the record here in store. (just this record would be enough)!!!
To reload the store I tried:
view.store.load(); does not work!!!
allthough I see in debuginfo that the store is (re)loaded.

Is there a simple solution. Why does reload not work. I know reload() is async.
SO I tried
view.store.on('load', view.store.refresh());
Allthough the load event is fired: Doesn't work.



*/
},
exception : function(form, result){
Ext.Msg.alert('Incidenten', 'incident: ' + incident + ' niet gewijzigd', Ext.emptyFn);
form.destroy();
}
},

dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: [{
xtype: 'spacer'
}, {
text: 'Annuleer',
handler: function() {
form.destroy();
}
}, {
text: 'Wijzig',
ui: 'confirm',
handler: function() {
form.submit({
params: {
Id: incidentid,
userProfielId: profielid,
task: 'UPDATE'
},
waitMsg : {message:'Submitting', cls : 'demos-loading'}
});
}
}]
}]
};
}
if(view.id == 'In Behandeling') {
var formBase = {
scroll: 'vertical',
url: 'generator-grid/BackendGrid/incidentGridBackend.php',
standardSubmit : false,
items: [{
xtype: 'fieldset',
title: 'Wijzig Incident status (In behandeling) ' + incident,
instructions: 'Wijzig status. Schrijf evt een toelichting.',
defaults: {
labelAlign: 'left',
labelWidth: '35%'
},
items: [{
xtype: 'textfield',
name : 'Toelichtinginbehandeling',
label: 'Toelichting'
}, {
xtype: 'selectfield',
id : 'IncidentstatusInbehandeling',
name : 'IncidentstatusId',
label: 'Nieuwe status',
options: [
{text: 'Uitvoering', value: '4'},
{text: 'Niet opgelost', value: '6'}
]
}]
}],
listeners : {
submit : function(form, result){
var incidentstatusid = incidentstatus[Ext.getCmp('IncidentstatusInbehandeling').getValue()];
form.destroy();
rec.set('Incidentstatus', incidentstatusid);
view.refresh();
view.store.clearFilter();
view.store.filter('Incidentstatus', 'In Behandeling');
fmis.Main.ui.navigationBar.setTitle('Incidenten In Behandeling (' + view.store.getCount() + ')');
fmis.Main.ui.navigationBar.doComponentLayout();
},
exception : function(form, result){
Ext.Msg.alert('Incidenten', 'incident: ' + incident + ' niet gewijzigd', Ext.emptyFn);
form.destroy();
}
},

dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: [{
xtype: 'spacer'
}, {
text: 'Annuleer',
handler: function() {
form.destroy();
}
}, {
text: 'Wijzig',
ui: 'confirm',
handler: function() {
form.submit({
params: {
Id: incidentid,
userProfielId: profielid,
task: 'UPDATE'
},
waitMsg : {message:'Submitting', cls : 'demos-loading'}
});
}
}]
}]
};
}

if(view.id == 'Uitvoering') {
var formBase = {
scroll: 'vertical',
url: 'generator-grid/BackendGrid/incidentGridBackend.php',
standardSubmit : false,
items: [{
xtype: 'fieldset',
title: 'Wijzig Incident status (Uitvoering) ' + incident,
defaults: {
labelAlign: 'left',
labelWidth: '35%'
},
items: [{
xtype: 'textfield',
name : 'Toelichtinguitvoering',
label: 'Toelichting'
}, {
xtype: 'selectfield',
id : 'IncidentstatusUitvoering',
name : 'IncidentstatusId',
label: 'Nieuwe status',
options: [
{text: 'Opgelost', value: '5'},
{text: 'Niet opgelost', value: '6'}
]
}]
}],

listeners : {
submit : function(form, result){
var incidentstatusid = incidentstatus[Ext.getCmp('IncidentstatusUitvoering').getValue()];
form.destroy();
rec.set('Incidentstatus', incidentstatusid);
view.refresh();
view.store.clearFilter();
view.store.filter('Incidentstatus', 'Uitvoering');
fmis.Main.ui.navigationBar.setTitle('Incidenten Uitvoering (' + view.store.getCount() + ')');
fmis.Main.ui.navigationBar.doComponentLayout();
},
exception : function(form, result){
Ext.Msg.alert('Incidenten', 'incident: ' + incident + ' niet gewijzigd', Ext.emptyFn);
form.destroy();
}
},

dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: [{
xtype: 'spacer'
}, {
text: 'Annuleer',
handler: function() {
form.destroy();
}
}, {
text: 'Wijzig',
ui: 'confirm',
handler: function() {
form.submit({
params: {
Id: incidentid,
userProfielId: profielid,
task: 'UPDATE'
},
waitMsg : {message:'Submitting', cls : 'demos-loading'}
});
}
}]
}]
};
}
if(view.id == 'Opgelost') {
var formBase = {
scroll: 'vertical',
url: 'generator-grid/BackendGrid/incidentGridBackend.php',
standardSubmit : false,
items: [{
xtype: 'fieldset',
title: 'Wijzig Incident status (Opgelost) ' + incident,
defaults: {
labelAlign: 'left',
labelWidth: '35%'
},
items: [{
xtype: 'textfield',
name : 'Toelichtinguitvoering',
label: 'Toelichting'
}, {
xtype: 'selectfield',
id : 'IncidentstatusOpgelost',
name : 'IncidentstatusId',
label: 'Nieuwe status',
options: [
{text: 'Gesloten', value: '7'},
{text: 'In Behandeling', value: '3'}
]
}]
}],

listeners : {
submit : function(form, result){
var incidentstatusid = incidentstatus[Ext.getCmp('IncidentstatusOpgelost').getValue()];
form.destroy();
rec.set('Incidentstatus', incidentstatusid);
view.refresh();
view.store.clearFilter();
view.store.filter('Incidentstatus', 'Opgelost');
fmis.Main.ui.navigationBar.setTitle('Incidenten Opgelost (' + view.store.getCount() + ')');
fmis.Main.ui.navigationBar.doComponentLayout();
},
exception : function(form, result){
Ext.Msg.alert('Incidenten', 'incident: ' + incident + ' niet gewijzigd', Ext.emptyFn);
form.destroy();
}
},

dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: [{
xtype: 'spacer'
}, {
text: 'Annuleer',
handler: function() {
form.destroy();
}
}, {
text: 'Wijzig',
ui: 'confirm',
handler: function() {
form.submit({
params: {
Id: incidentid,
userProfielId: profielid,
task: 'UPDATE'
},
waitMsg : {message:'Submitting', cls : 'demos-loading'}
});
}
}]
}]
};
}
if(view.id == 'Niet Opgelost') {
var formBase = {
scroll: 'vertical',
url: 'generator-grid/BackendGrid/incidentGridBackend.php',
standardSubmit : false,
items: [{
xtype: 'fieldset',
title: 'Wijzig Incident status (Niet Opgelost) ' + incident,
defaults: {
labelAlign: 'left',
labelWidth: '35%'
},
items: [{
xtype: 'textfield',
name : 'Toelichtinguitvoering',
label: 'Toelichting'
}, {
xtype: 'selectfield',
id : 'IncidentstatusNietopgelost',
name : 'IncidentstatusId',
label: 'Nieuwe status',
options: [
{text: 'Gesloten', value: '7'},
{text: 'In Behandeling', value: '3'}
]
}]
}],

listeners : {
submit : function(form, result){
var incidentstatusid = incidentstatus[Ext.getCmp('IncidentstatusNietopgelost').getValue()];
form.destroy();
rec.set('Incidentstatus', incidentstatusid);
view.refresh();
view.store.clearFilter();
view.store.filter('Incidentstatus', 'Niet Opgelost');
fmis.Main.ui.navigationBar.setTitle('Incidenten Niet opgelost (' + view.store.getCount() + ')');
fmis.Main.ui.navigationBar.doComponentLayout();
},
exception : function(form, result){
Ext.Msg.alert('Incidenten', 'incident: ' + incident + ' niet gewijzigd', Ext.emptyFn);
form.destroy();
}
},

dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: [{
xtype: 'spacer'
}, {
text: 'Annuleer',
handler: function() {
form.destroy();
}
}, {
text: 'Wijzig',
ui: 'confirm',
handler: function() {
form.submit({
params: {
Id: incidentid,
userProfielId: profielid,
task: 'UPDATE'
},
waitMsg : {message:'Submitting', cls : 'demos-loading'}
});
}
}]
}]
};
}
if(view.id == 'Gesloten') {
var formBase = {
scroll: 'vertical',
url: 'generator-grid/BackendGrid/incidentGridBackend.php',
standardSubmit : false,
items: [{
xtype: 'fieldset',
title: 'Wijzig Incident status (Gesloten) ' + incident,
defaults: {
labelAlign: 'left',
labelWidth: '35%'
},
items: [{
xtype: 'selectfield',
id : 'IncidentstatusGesloten',
name : 'IncidentstatusId',
label: 'Nieuwe status',
options: [
{text: 'Archief', value: '8'},
{text: 'In Behandeling', value: '3'}
]
}]
}],

listeners : {
submit : function(form, result){
var incidentstatusid = incidentstatus[Ext.getCmp('IncidentstatusGesloten').getValue()];
form.destroy();
rec.set('Incidentstatus', incidentstatusid);
view.refresh();
view.store.clearFilter();
view.store.filter('Incidentstatus', 'Gesloten');
fmis.Main.ui.navigationBar.setTitle('Incidenten Gesloten (' + view.store.getCount() + ')');
fmis.Main.ui.navigationBar.doComponentLayout();
},
exception : function(form, result){
Ext.Msg.alert('Incidenten', 'incident: ' + incident + ' niet gewijzigd', Ext.emptyFn);
form.destroy();
}
},

dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: [{
xtype: 'spacer'
}, {
text: 'Annuleer',
handler: function() {
form.destroy();
}
}, {
text: 'Wijzig',
ui: 'confirm',
handler: function() {
form.submit({
params: {
Id: incidentid,
userProfielId: profielid,
task: 'UPDATE'
},
waitMsg : {message:'Submitting', cls : 'demos-loading'}
});
}
}]
}]
};
}

if (Ext.is.Phone) {
formBase.fullscreen = true;
} else {
Ext.apply(formBase, {
autoRender: true,
floating: true,
modal: true,
centered: true,
hideOnMaskTap: false,
// height: 'auto',
width: 580
});
}
// if(view.id == 'Nieuw') {
// formBase.fullscreen = true;
// }
form = new Ext.form.FormPanel(formBase);
form.show();
}
};
fmis.FormIncidentstatus.init(fmis.fsm);
}
}

pcr
19 Jan 2011, 8:01 AM
Hi I think I have solved this problem. I listen to the 'load' event of the store and start a doLayoutComponent() on the Carousel this way:



view.store.load();
view.store.on('load', function() {
view.store.filter('Incidentstatus', 'Nieuw');
fmis.serv.doLayoutComponent();
});


Just want to know is this the right approach????

pcr
21 Jan 2011, 9:09 AM
After some testing I do a doLayout(). It's not nice solution because the screen is empty during the loading mask. But it works