Closed rhkarls closed 1 year ago
Crazy! Thanks for spotting this, @rhkarls!
We don't even need pandas to reproduce this issue:
ui.aggrid({
'columnDefs': [{'field': 'id'}, {'field': 'comment'}],
'rowData': [
{'id': 1, 'comment': 'Comment with a date 2020-01-01'},
{'id': 2, 'comment': 'Another comment'},
{'id': 3, 'comment': 'On more normal comment'},
],
})
But with plain HTML the grid renders correctly:
<html>
<head>
<title>Ag Grid App</title>
<script src="https://cdn.jsdelivr.net/npm/ag-grid-community/dist/ag-grid-community.min.noStyle.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community/styles/ag-grid.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community/styles/ag-theme-alpine.css" />
</head>
<body>
<div id="myGrid" class="ag-theme-alpine"></div>
<script type="text/javascript">
new agGrid.Grid(document.getElementById("myGrid"), {
columnDefs: [{ field: "id" }, { field: "comment" }],
rowData: [
{ id: 1, comment: "Comment with a date 2020-01-01" },
{ id: 2, comment: "Another comment" },
{ id: 3, comment: "On more normal comment" },
],
});
</script>
</body>
</html>
@falkoschindler If you normalize to the version of aggrid that ships currently, the problem is visible:
<html>
<head>
<title>Ag Grid App</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ag-grid/30.0.3/ag-grid-community.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/ag-grid-community/styles/ag-grid.css"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/ag-grid-community/styles/ag-theme-alpine.css"
/>
</head>
<body>
<div id="myGrid" class="ag-theme-alpine"></div>
<script type="text/javascript">
new agGrid.Grid(document.getElementById("myGrid"), {
columnDefs: [{ field: "id" }, { field: "comment" }],
rowData: [
{ id: 1, comment: "Comment with a date 2020-01-01" },
{ id: 2, comment: "Another comment" },
{ id: 3, comment: "On more normal comment" },
],
});
</script>
</body>
</html>
Updating to the latest, seems to fix it as you saw.
Oh great! We'll update dependencies for the upcoming 1.4 release.
Description
This might be a symptom of something else, and not limited to the title and the case here. There is some strange behavior with
ui.aggrid
when a row contains a string with ayyyy-mm-dd
format.The issue does not appear with for example:
2020-01
,20-01-01
,words-with-hyphens
, but it does appear with2020-01-01-01
.Using version 1.3.17