@SuppressWarnings({"unchecked", "rawtypes"}) protected void onLoad(LoadEvent le) { this.config = (ListLoadConfig) le.getConfig(); Object data = le.getData(); removeAll(); if (data == null) { all = new ArrayList(); } else if (data instanceof List) { List<M> list = (List) data; all = new ArrayList(list); } else if (data instanceof ListLoadResult) { all = new ArrayList(((ListLoadResult) data).getData()); } for (M m : all) { registerModel(m); } if (config != null && config.getSortInfo() != null && !Util.isEmptyString(config.getSortInfo().getSortField())) { sortInfo = config.getSortInfo(); } else { sortInfo = new SortInfo(); } if (filtersEnabled) { filtersEnabled = false; applyFilters(filterProperty); } if (storeSorter != null) { applySort(true); } fireEvent(DataChanged, createStoreEvent()); }
protected void onBeforeLoad(LoadEvent le) { if (!le.isCancelled() && !fireEvent(BeforeDataChanged, createStoreEvent())) { le.setCancelled(true); } }