Async load collection for editors
See original GitHub issueHello, I have next workflow: Getting data for collection is deferred. How can I organize properly load of grid?
next tries didn’t work: (I tried to re-init grid after filling collection)
this.dataService.getStatuses().subscribe(data => {
this.columns[0].editor.collection = data.map(item => ({ label: item.desc, value: item.id }))
// this.grid.gridService.resetGrid(this.columns);
this.grid.gridService.init(this.grid.slickGrid, this.dataset);
}, this.handleError);
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
How to async loading scene in editor? - Unity Forum
hello. I want async loading scene in editor .. Because, in my project, it is a project that creates only scenes without using...
Read more >Async loaded .NET projects may impact Visual Studio ...
NET projects may impact Visual Studio extensions. In Visual Studio 2019 version 16.3, the CSProj project system (C#/VB non-SDK style) ...
Read more >How To Handle Async Data Loading, Lazy Loading, and Code ...
Step 1 — Loading Asynchronous Data with useEffect. In this step, you'll use the useEffect Hook to load asynchronous data into a sample ......
Read more >Use timing changes to load elements on the page ... - Optimizely
Visual Editor · From the Experiments tab, click Variations. · Select the variation you want to load asynchronously. · Under Changes, select the ......
Read more >Asynchronous Asset Loading - Unreal Engine Documentation
In this example, ItemList is a TArray< TSoftObjectPtr<UGameItem> > that was modified by designers in the editor. The code iterates that list, converts...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@asdman384 @YadavAvinashK I started some work to address this, it’s a work in progress but I have the proof of concept working (not entirely tested though). You can provide feedback now before I push the code. I currently only worked on the Filter but the Editor will behave exactly the same.
Step 1 - use a new
asyncCollection
propertyI created a new property named
asyncCollection
which accepts an Observable/Subject, so typically you would simply pass an HttpClient Observable. Also note that when you useasyncCollection
, the othercollection
property can be omitted (however note the library itself will still use thecollection
property). So the code could look like the followingStep 2 - how to refresh the Filter / Editor collection?
If you want to refresh or change the collection used by the Filter or Editor, you can still use the
collection
which will always contain the latest array used by the Filter/Editor (basically every time the async resolves, the lib updates thecollection
property). However, there’s a slight problem, I could not find a way to simply watch thecollection
(like$watchCollection
in AngularJS), so in order for the lib to know there’s a change, the only way I found is by triggering anext
on the Observable. So the code looks like the followingIf someone knows how to do the same as
$watchCollection
like we had in AngularJS, please let me know and provide a solution on the SO question, which got down voted 😦 I would really like to get rid of the extraasyncCollection.next(collection)
call.Also note that I did the proof of concept only locally with
setTimeout
and aSubject
which is not anHttpClient
call but it should work the same, see below for a quick demo. Below, I’m adding 2 new rows which will add 2 new options to the filter (500 & 501).This feature is now available in version 1.4.0
If you haven’t yet voted, please do ⭐️ Cheers