Hello,
I'm working on a project in which I'd consume data from the backend and, project it in a grid.
When I used local data, it worked fine. And by fine I mean the columns' header text is being changed based on the data source's fields.
However, now when I affected the fetched data source from an observable, I get the whole data source as it is, and displayed I in the grid.
In other words, the columns defined in "datatable.html" are 8, but the Datagrid brings all of the columns which are 11.
Not, that the data source type of an "EntityModel", and everything is defined, but I don't understand why it ignores the HTML columns, renaming, and the newly added columns.
I tried to follow predefining in"gridObj" but don't know how to override the HTML grid, although I want to avoid defining columns in typescript.
So basically, The data fetched is overriding I guess the column laid out already in the HTML and displaying the field names of the data source as-is and all of them instead of following the columns' names provided
Please help, and thanks in advance.
Attachment: datatable_e9cb738d.rar
|
[datatable.component.html]
<ejs-grid
[dataSource]="data"
#grid
---
>
<e-columns> // define the columns inside the <e-columns> tag
<e-column type="checkbox" width="50"></e-column>
<e-column field="fichieR_OPERATION" headerText="Fichier" width="75"></e-column>
<e-column field="Actions" headerText="Actions" width="200"></e-column>
</e-columns>
</ejs-grid>
|
Hello Syncfusion Team,
As embarrassing as it may seem, I discovered that just moments ago,
thank you for getting back to me.
On another note, since we're talking about columns, do you think you could help me figure out
how to solve the date with this format? "2002-02-01T00:00:00+01:00".
I tried formatOptions on the columns but it displays odd results as so 0or0AMtOption0
formatOptions: { type:'date', format:'dd/MM/yyyy'}, and if I don't use the format option I get a long datetime.
As so Fri Feb 01 2002 00:00:00 GMT+0100 (West Africa Standard Time)
|
[app.component.html]
<e-column
field="OrderDate"
type="date"
[format]="formatOptions"
headerText="Echeance"
width="175"
>
</e-column>
[app.component.ts]
public formatOptions: Object = { type: 'date', format: 'dd/MM/yyyy' };
|
Add to that I was declaring options to "formatOptions"
instead of assigning them.
Thanks a lot for your help!