Hello. I have two grids in my page. The first has rows created by my Razor template, and I may later add new rows using the URL manager INSERT url. Everything works ok.
<e-grid-column field="lastOperation" width="85" headerText="Updated" allowEditing="false" format="yMd"></e-grid-column>
The second grid starts empty, but when I click on a row in the first grid, I load rows for the second grid. I use the same basic code that the documentation uses to explain how the "refresh()" method works. Here is a typical column on the second table:
<e-grid-column field="uploadDate" isPrimaryKey="false" visible="true" width="75" headerText="Date" format="yMd"></e-grid-column>
Again, I am using a data format "yMd".
I use this code to update the second (as the success function to an $.Ajax call)
success: function (result, status, xhr) {
const videoGrid = document.getElementById("VideoGrid").ej2_instances[0];
videoGrid.dataSource.splice(0, videoGrid.dataSource.length);
for (var video of result) {
videoGrid.dataSource.unshift(video);
}
videoGrid.refresh();
...
Basically, just adding rows to the gird.dataSource array. The problem here is that the formatting specified in the original column is not applied when adding rows dynamically.
Am I doing something wrong or is the application of the formatting not possible in this case?
thank in advance.
dennis.