We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Observable datasource is not working

Hi,

I recently chanced upon SyncFusion and decided to try out a prototype with the syncfusion angular toolkit (components), for a client. If the exercise is promising, then their product will leverage syncfusion and would like to recommend their use commercially. As a beginner, I have a few queries which I hope can be answered by your good selves.

* How does the license work? Should any license key installation required to be part of the Angular project to enable the components? So far, I can see only npm open registry for component installations. Please clarify.

* I tried the treegrid as the first component. I managed to get the local datasource (as in <AngularType>[]). However, the dataSourceChanged event was not working for me to add/edit rows inline the grid, store in my backend using prorpietary typescript code (components + services combination). I then pored through your forums and somehow was indirected to async example. I followed the sample to the dot, but this time, the treegrid is not showing up with some errors printed on JS Console in Chrome browser.
> The first instance is below. I assume this is because of async and so the component troies to render data which doesnt exist yet (not fetched from DataService yet). However, this will not be acceptable for production behaviour. I would like to know what is wrong here and how to fix the same.
TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at DataManipulation.convertToFlatData (ej2-treegrid.es2015.js:1277)
    at ComponentBase.convertTreeData (ej2-treegrid.es2015.js:3533)
    at ComponentBase.render (ej2-treegrid.es2015.js:3498)
    at ComponentBase.appendTo (ej2-base.es2015.js:5183)
    at component-base.js:100
    at ZoneDelegate.invokeTask (zone-evergreen.js:391)
    at Object.onInvokeTask (core.js:39679)
    at ZoneDelegate.invokeTask (zone-evergreen.js:390)
    at Zone.runTask (zone-evergreen.js:168)

> The second instance is below. This is more serious, because this does not render the treegrid on the screen at all. I have followed the async example as close as possible, only difference is where and how data is (Observable) is returned. Since none of your code examples i have seen (relevant to this component) present module.ts, i am at a loss as what is missing to cause this error. Also, to note, there is a @Inject('sourceFiles') in your code examples which has been trivialized in your forums and recommended to be ignored. It is confusing to a newbie like me. 
TypeError: Cannot read property 'getService' of undefined
    at new Selection (ej2-grids.es2015.js:7580)
    at createInstance (ej2-base.es2015.js:13)
    at ModuleLoader.inject (ej2-base.es2015.js:2458)
    at Grid.injectModules (ej2-base.es2015.js:5277)
    at Grid.dataBind (ej2-base.es2015.js:5202)
    at ComponentBase.dataBind (ej2-treegrid.es2015.js:4319)
    at ZoneDelegate.invokeTask (zone-evergreen.js:391)
    at Object.onInvokeTask (core.js:39679)
    at ZoneDelegate.invokeTask (zone-evergreen.js:390)
    at Zone.runTask (zone-evergreen.js:168)

I am attaching my implementation of treegrid async example, hoping I can get some help.

Thanks and best regards,
Sathya

Attachment: asynctreegrid_ceb9b013.zip

1 Reply

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team September 12, 2019 01:03 PM UTC

Hi Sathyanarayanan, 

Thanks for contacting Syncfusion Support. 

Query#1:- How does the license work? Should any license key installation required to be part of the Angular project to enable the components? So far, I can see only npm open registry for component installations. Please clarify.  

Yes anybody can download our npm package. However, to use our package legally they needed to get license from us by visiting syncfusion.com and signing up for license. This is also mentioned in our licensing document in npm package. Please find its content from GitHub link  
   
We don’t have any source level license validation, so you don’t have to do anything in your application for license validation. Our current license validation are fully based on support and new feature requests. 

Query#2,3:-   

We doesn’t have support for dataSourceChanged event in our Ej2 TreeGrid. We have implemented this feature in our upcoming main release  2019 Volume 3. Once implemented you can use this feature at your end. 

Till then we appreciate your patience. 

Regards, 
Farveen sulthana T 


Loader.
Live Chat Icon For mobile
Up arrow icon