JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" type="text/css" href="//cdn.sencha.io/ext-4.1.0-gpl/resources/css/ext-all-debug.css" />
CSS
.total-cost-label {
color: #165aa9;
font-size: 12px;
}
.price-label {
color: #165aa9;
font-size: 14px;
font-weight: bold;
}
.add-to-bom-button {
background: #014470;
background: -webkit-gradient(linear, left top, left bottom, from(#279ff0), to(#014470));
background: -webkit-linear-gradient(top, #279ff0, #014470);
background: -moz-linear-gradient(top, #279ff0, #014470);
background: -ms-linear-gradient(top, #279ff0, #014470);
background: -o-linear-gradient(top, #279ff0, #014470);
padding: 3px 4px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
color: white;
font-size: 16px;
text-decoration: none;
vertical-align: middle;
cursor: pointer;
text-align: center;
}
.add-to-bom-button:hover {
border-top-color: #28597a;
background: #28597a;
color: #ffffff;
}
.add-to-bom-button:active {
border-top-color: #1b435e;
background: #1b435e;
}
JavaScript
var data = [{
id: 1,
name: 'Cellphone',
price: 20
}, {
id: 2,
name: 'Book',
price: 6
}, {
id: 3,
name: 'Laptop',
price: 50
},
];
Ext.define('Product', {
extend: 'Ext.data.Model',
fields: [{
name: 'id',
type: 'int'
}, {
name: 'name',
type: 'string'
}, {
name: 'price'
}],
});
Ext.create('Ext.data.Store', {
storeId: 'Products',
model: "Product",
data: data,
autoLoad: true,
proxy: {
type: 'memory',
reader: {
type: 'json'
}
}
});
var costContainer = Ext.create('Ext.container.Container', {
border: false,
layout: 'vbox',
items: [{
xtype: 'label',
html: 'Total Cost',
cls: 'total-cost-label'
}, {
xtype: 'label',
html: '$ 66,000',
cls: 'price-label'
},
]
});
Ext.create('Ext.grid.Panel', {
title: 'Products',
renderTo: Ext.getBody(),
store: Ext.getStore('Products'),
columns: [{
text: 'Price',
dataIndex: 'price',
flex: 1,
sortable: true
}, {
text: 'Name',
dataIndex: 'name',
flex: 1,
sortable: true
}
],
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
border: false,
style: {
background: 'white'
},
items: [{
text: 'Add to BoM',
cls: 'add-to-bom-button'
}, {
text: 'Cancel',
cls: 'cancel-button'
}]
},
{
xtype: 'toolbar',
dock: 'bottom',
border: false,
style: {
background: 'white'
}, items: [costContainer]
}]
});