Hi guys,
Sometimes we need to check if store is loaded or not (to track if there was at least 1 first request to server made, or one store.data assigned). We've come up with a solution that covers most of the cases (we need to add tests for store.tree: true and with lazy too)
Would you see adding this as a feature request ? Also do you see any issues with this solution ?
import Store from '@bryntum/grid/source/lib/Core/data/Store';
const { afterLoadData } = Store.prototype;
Store.prototype.afterLoadData = function () {
// _loadedOnce is used in StoreLazyLoadPlugin, so let's reuse it for isLoaded too
this._loadedOnce = true;
if (afterLoadData) {
afterLoadData.apply(this, arguments);
}
};
/**
* _loadedOnce is used in StoreLazyLoadPlugin, so let's reuse it for isLoaded too
* @return {boolean}
*/
Store.prototype.isLoaded = function () {
return Boolean(this._loadedOnce);
};Thanks
Vadim