-
Notifications
You must be signed in to change notification settings - Fork 81
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 #8378 from infor-design/8206-lookup-css
8206 - Added css setting for lookup
- Loading branch information
Showing
3 changed files
with
77 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,74 @@ | ||
<style> | ||
.lookup-test h1 { | ||
color: red; | ||
} | ||
</style> | ||
<div class="row"> | ||
<div class="twelve columns"> | ||
<div class="field"> | ||
<label for="product-lookup" class="label required">Products</label> | ||
<input id="product-lookup" data-init="false" data-validate="required" class="lookup" name="product-lookup" type="text"/> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
var grid, | ||
columns = [], | ||
data = []; | ||
|
||
// Some Sample Data | ||
data.push({ id: 1, productId: 2142201, productName: 'Compressor', activity: 'Assemble Paint', quantity: 1, price: 210.99, status: 'OK', orderDate: new Date(2014, 12, 8), action: 'Action'}); | ||
data.push({ id: 2, productId: 2241202, productName: 'Different Compressor', activity: 'Inspect and Repair', quantity: 2, price: 210.99, status: '', orderDate: new Date(2015, 7, 3), action: 'On Hold'}); | ||
data.push({ id: 3, productId: 2342203, productName: 'Compressor', activity: 'Inspect and Repair', quantity: 1, price: 120.99, status: null, orderDate: new Date(2014, 6, 3), action: 'Action'}); | ||
data.push({ id: 4, productId: 2445204, productName: 'Another Compressor', activity: 'Assemble Paint', quantity: 3, price: 210.99, status: 'OK', orderDate: new Date(2015, 3, 3), action: 'Action'}); | ||
data.push({ id: 5, productId: 2542205, productName: 'I Love Compressors', activity: 'Inspect and Repair', quantity: 4, price: 210.99, status: 'OK', orderDate: new Date(2015, 5, 5), action: 'On Hold'}); | ||
data.push({ id: 5, productId: 2642205, productName: 'Air Compressors', activity: 'Inspect and Repair', quantity: 41, price: 120.99, status: 'OK', orderDate: new Date(2014, 6, 9), action: 'On Hold'}); | ||
data.push({ id: 6, productId: 2642206, productName: 'Some Compressor', activity: 'inspect and Repair', quantity: 41, price: 123.99, status: 'OK', orderDate: new Date(2014, 6, 9), action: 'On Hold'}); | ||
data.push({ id: 7, productId: 2642207, productName: "Someone's Compressor", activity: "Inspect's and Repair's", quantity: 41, price: 123.99, status: 'OK', orderDate: new Date(2014, 6, 9), action: 'On Hold'}); | ||
|
||
//Define Columns for the Grid. | ||
columns.push({ id: 'productId', name: 'Product Id', field: 'productId'}); | ||
columns.push({ id: 'productName', name: 'Product Name', field: 'productName', formatter: Soho.Formatters.Hyperlink}); | ||
columns.push({ id: 'activity', hidden: true, name: 'Activity', field: 'activity'}); | ||
columns.push({ id: 'quantity', filterType: 'text', name: 'Quantity', field: 'quantity'}); | ||
columns.push({ id: 'price', name: 'Price', field: 'price', formatter: Soho.Formatters.Decimal}); | ||
|
||
$('body').on('initialized', function () { | ||
//Init and get the api for the grid | ||
$('#product-lookup').lookup({ | ||
field: 'productId', | ||
autoApply: true, | ||
autoFocus: false, | ||
modalSettings: { | ||
fullsize: 'responsive', | ||
breakpoint: 'phone-to-tablet' | ||
}, | ||
cssClass: 'lookup-test', | ||
options: { | ||
columns: columns, | ||
dataset: data, | ||
selectable: 'single', | ||
rowNavigation: true, | ||
toolbar: { | ||
results: true, | ||
keywordFilter: true, | ||
advancedFilter: false, | ||
actions: false, | ||
selectable: 'single', | ||
filterable: true, | ||
views: true, | ||
rowHeight: false, | ||
collapsibleFilter: false, | ||
fullWidth: true | ||
} | ||
}, | ||
attributes: [ | ||
{ | ||
name: 'data-automation-id', | ||
value: 'my-lookup' | ||
} | ||
] | ||
}); | ||
}); | ||
</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