Reputation: 3
I have created a fairly complex ExtJs app (using version 7.4 modern toolkit) that has some "modules" that use a transaction model, that is, a single instance of the model can be loaded at a time, and navigation controls enable loading a specific transaction id.
This app runs fine on a desktop, but we recently tried running it on an Android tablet, and after loading a few transactions, the app locks up. Sometimes it will start working again after a long delay, as though the system was overloaded.
I have been able to reproduce the problem on my development desktop by simply loading the page in tablet/responsive mode, so it appears that ExtJs handles things differently if it detects a non-desktop device.
Has anyone run into this kind of overload problem? Any pointers for where I should be troubleshooting?
Thanks!
Update:
Here is my base model, which includes a schema:
Ext.define('App.model.Base', {
extend: 'Ext.data.Model',
requires: [
'Ext.data.identifier.Negative',
],
identifier: 'negative',
fields: [
{name: 'id', type: 'int', unique: true},
],
schema: {
// Setting the models namespace to produce proper association getter names.
// https://docs.sencha.com/extjs/7.4.0/modern/Ext.data.schema.Schema.html
namespace: 'App.model',
proxy: {
type: 'restApp',
url: 'rest/{entityName}',
},
},
});
Update December 31:
Here is a link to a video demonstrating the problem I'm experiencing.
Upvotes: 0
Views: 56
Reputation: 3
It turns out the timing-out issue was due to the fact that my navigation system was based on a combobox that loaded a store of the ids of all the transactions. Although this was not raising any issues in desktop mode, apparently loading several thousand records in device mode was locking up memory or something.
I refactored the UI to be based on a simple textbox backed by a model that keeps track of the first and last possible ids, and the issue is resolved.
Upvotes: 0
Reputation: 5054
I just take a wild guess: You added a scheme to the model.
Most likely you have a racing condition in you application. This does not matter on desktop, but might on other devices.
Ensure to require the scheme in your model.
In your case add somthing like this to the model:
requires: ['MyApp.model.SchemeName'],
To figure out, what might happen, do a test build (sencha app build testing
).
You might have required all app-files (requires: ['MyApp.*']
), but on top of that you need to require the SchemeName in that model:
The main problem is, that sometimes your Model is loaded before your Scheme (might be alphabetically so some Models do not need it and some do) => and that way the constructor runs before the Scheme is known.
Docs
https://docs.sencha.com/extjs/7.7.0/modern/Ext.data.schema.Schema.html
Ext.define('MyApp.model.Base', {
extend: 'Ext.data.Model',
schema: {
namespace: 'MyApp.model'
}
});
This defines that the proxy calls from baseUrl/base
, because MyApp.model
is cut from the filename. And has a couple of other advantages.
Upvotes: 0