-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8071. Fix on new row not showing error tooltip on first cell
- Loading branch information
1 parent
09f6ffa
commit 0face4d
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters