-
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.
Merge pull request #8371 from infor-design/8198-datagrid-frozen-cols
8198 - Datagrid Frozen Column Prevent Reorder
- Loading branch information
Showing
3 changed files
with
95 additions
and
2 deletions.
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,48 @@ | ||
<div class="full-height full-width"> | ||
<div id="datagrid" class="datagrid"> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
$('body').one('initialized', function () { | ||
var grid, | ||
columns = [], | ||
data = []; | ||
|
||
var url = '{{basepath}}api/compressors?pageNum=1&pageSize=100'; | ||
$.getJSON(url, function(res) { | ||
data = res.data; | ||
|
||
// Define Columns for the Grid. | ||
columns.push({ id: 'productId', reorderable: false, name: 'Product Id', field: 'productId', formatter: Soho.Formatters.Text}); | ||
// columns.push({ id: 'productName', name: 'Product Name', field: 'productName', formatter: Soho.Formatters.Hyperlink, href: 'http://www.google.com', target: '_blank'}); | ||
columns.push({ id: 'activity', name: 'Activity', field: 'activity'}); | ||
columns.push({ id: 'quantity', name: 'Quantity', field: 'quantity'}); | ||
// columns.push({ id: 'orderDate', name: 'Order Date', field: 'orderDate', formatter: Soho.Formatters.Date, dateFormat: 'M/d/yyyy'}); | ||
// 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: 'status', name: 'Status', field: 'status', formatter: Soho.Formatters.Text}); | ||
// columns.push({ id: 'pumpLife', name: 'Pump Life', field: 'pumpLife'}); | ||
// columns.push({ id: 'ratedTemp', name: 'Temp. Rating', field: 'ratedTemp'}); | ||
// columns.push({ id: 'productSku', name: 'Sku', field: 'productSku'}); | ||
// columns.push({ id: 'action', name: 'Action', field: 'action'}); | ||
// columns.push({ id: 'rpm', name: 'Motor Rpm', field: 'rpm'}); | ||
// columns.push({ id: 'maxPressure', name: 'Max Pressure', field: 'maxPressure'}); | ||
// columns.push({ id: 'weight', name: 'Weight', field: 'weight'}); | ||
// columns.push({ id: 'actionButton', name: 'Button', field: '', text: 'Buy Now', align: 'center', sortable: false, formatter: Soho.Formatters.Button, click: function (e, args) {console.log('Button was clicked', args);}, width: 160, exportable: false}); | ||
|
||
// Init and get the api for the grid | ||
$('#datagrid').datagrid({ | ||
columns: columns, | ||
columnReorder: true, | ||
dataset: data, | ||
paging: true, | ||
pagesize: 50, | ||
frozenColumns: { | ||
left: ['productId'], | ||
// right: ['actionButton'] | ||
}, | ||
toolbar: {title: 'Compressors', actions: true, rowHeight: true, results: true, personalize: true, exportToExcel: true } | ||
}); | ||
}); | ||
}); | ||
</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