How can I set an Observable returned by angular2 http service as a grid's (or any other control's for that matter) datasource?
I've reviewed the samples on github but there all the data is populated right in the component's constructor.Observables are async and by the time data is returned it's too late to bind it to the grid.
Actually, if I don't set grid's datasource to something righ in the constructor (or ngOnInit) I'm getting "Unexpected token u in JSON at position 0" right on line 335 of igniteui.anular2.js because datasource is 'undefined'.
Line 335 : this._dataSource = JSON.parse(JSON.stringify(this._config.dataSource));Please help.Thank you.
Ok, I see. You have to configure columns manually. If you set autoGenerateColumns to true nothing appears on the screen.
It is not recommended to use autoGenerateColumns when the initial data source set is empty.
In this case the grid will have nothing from which to actually generate its columns so the columns collection will be empty.
The schema for the data source is generated only once so even if the dataSource is changed at a later point the columns collection would not be re-generated and will remain empty.
Let me know if you have any questions.
Thank you. I ended up not using the grid for now anyway because of the complications with complex data I have here but I'll check on this later.