Skip to content

Commit

Permalink
8071. Fix on new row not showing error tooltip on first cell
Browse files Browse the repository at this point in the history
  • Loading branch information
yohannahbautista committed Nov 7, 2023
1 parent 09f6ffa commit 0face4d
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
52 changes: 52 additions & 0 deletions app/views/components/datagrid/test-newrow-error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<div class="row">
<div class="twelve columns">
<div role="toolbar" class="toolbar">
<div class="buttonset">
<button type="button" id="add-row-button" class="btn">
<span>Add Row</span>
</button>
<button type="button" id="add-error-button" class="btn">
<span>Add Error</span>
</button>
</div>
</div>
<div id="datagrid" class="datagrid">
</div>
</div>
</div>

<script id="datagrid-script">
$('body').one('initialized', function () {

let columns = [];
let gridApi;

$.getJSON('{{basepath}}api/datagrid-sample-data', function(res) {
columns.push({ id: 'productId', hideable: false, name: 'Id', field: 'productId', formatter: Soho.Formatters.Text, whiteSpace: 'pre-wrap' });
columns.push({ id: 'productName', name: 'Product Name', field: 'productName', formatter: Soho.Formatters.Hyperlink, click: function(e) { console.log('Click Fired') }, whiteSpace: 'pre-wrap' });
columns.push({ id: 'activity', name: 'Activity', field: 'activity'});
columns.push({ id: 'hidden', hidden: true, name: 'Hidden', field: 'hidden'});
columns.push({ id: 'price', align: 'right', name: 'Actual Price', field: 'price', formatter: Soho.Formatters.Decimal, numberFormat: {minimumFractionDigits: 0, maximumFractionDigits: 0, style: 'currency', currencySign: '$'}});
columns.push({ id: 'percent', align: 'right', name: 'Actual %', field: 'percent', formatter: Soho.Formatters.Decimal, numberFormat: {minimumFractionDigits: 0, maximumFractionDigits: 0, style: 'percent'}});
columns.push({ id: 'orderDate', name: 'Order Date', field: 'orderDate', formatter: Soho.Formatters.Date, dateFormat: 'M/d/yyyy'});
columns.push({ id: 'phone', name: 'Phone', field: 'phone', formatter: Soho.Formatters.Text});

gridApi = $('#datagrid').datagrid({
columns: columns,
dataset: res,
saveColumns: false,
attributes: [{ name: 'id', value: 'custom-id' }, { name: 'data-automation-id', value: 'custom-automation-id' } ],
toolbar: {title: 'Compressors', results: true, actions: true, rowHeight: true, personalize: true}
}).data('datagrid');

$('#add-row-button').on('click', function (e) {
gridApi.addRow({}, 0);
});

$('#add-error-button').on('click', function (e) {
gridApi.showCellError(0, 0, "TOOLTIP ERROR MESSAGE 0", "error");
gridApi.showCellError(0, 1, "TOOLTIP ERROR MESSAGE 1", "error");
});
});
});
</script>
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- `[Datagrid]` Whitespace should be shown on cell when expanded. ([#7848](https://github.com/infor-design/enterprise/issues/7848))
- `[Datagrid]` Additional check for modal width. ([#7923](https://github.com/infor-design/enterprise/issues/7923))
- `[Datagrid]` Additional check for select row when datagrid has grouping and filter. ([NG#1549](https://github.com/infor-design/enterprise-ng/issues/1549))
- `[Datagrid]` Fix on new row not showing error tooltip on first cell. ([#8071](https://github.com/infor-design/enterprise/issues/8071))
- `[Datepicker]` Adjusted sizing of monthview popup to better accommodate smaller dimensions. ([#7974](https://github.com/infor-design/enterprise/issues/7974))
- `[Datepicker]` Fixed datepicker prematurely closing after selecting a date when having a time format. ([#7916](https://github.com/infor-design/enterprise/issues/7916))
- `[General]` Adjusted the reset for spans. ([#1513](https://github.com/infor-design/enterprise/issues/7854))
Expand Down
2 changes: 1 addition & 1 deletion src/components/datagrid/datagrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -5703,7 +5703,7 @@ Datagrid.prototype = {
// Set selector
const selector = {
th: '.datagrid-header th',
td: '.datagrid-wrapper tbody tr.datagrid-row td[role="gridcell"]:not(.rowstatus-cell)',
td: '.datagrid-wrapper tbody tr.datagrid-row td[role="gridcell"]',
rowstatus: '.datagrid-wrapper tbody tr.datagrid-row td[role="gridcell"] .icon-rowstatus',
headerIcon: '.datagrid-header th .datagrid-header-icon'
};
Expand Down

0 comments on commit 0face4d

Please sign in to comment.