Enables creation of data grid applications in AngularJS.
The current version should be deployed here: http://ng-datagrid.handsontable.com/split-screen.html
You can also clone this repo and run split-screen.html in your browser
Include the library files (see dist/ directory):
<script src="lib/jquery.min.js"></script>
<script src="lib/angular.min.js"></script>
<script src="dist/angular-ui-handsontable.full.js"></script>
<link rel="stylesheet" media="screen" href="dist/angular-ui-handsontable.full.css">Template:
<div minSpareRows="1" datarows="item in items">
<datacolumn value="item.id" title="'ID'"></datacolumn>
<datacolumn type="grayedOut" value="item.name.first" title="'First Name'" readOnly></datacolumn>
<datacolumn type="grayedOut" value="item.name.last" title="'Last Name'" readOnly></datacolumn>
<datacolumn value="item.address" title="'Address'"></datacolumn>
<datacolumn value="item.Product.Description" title="'Favorite food'" type="'autocomplete'" live strict>
<optionlist datarows="option in item.Product.Options"
clickrow="item.Product.Description = option.Description">
<img src="{{option.Image}}" style="width: 16px; height: 16px; border-width: 0">
{{option.Description}}
</optionlist>
</datacolumn>
<datacolumn type="'checkbox'" value="item.isActive" title="'Is active'" checkedTemplate="'Yes'"
uncheckedTemplate="'No'"></datacolumn>
</div>Controller:
$scope.items = [
{
id: 1,
name: {
first: "Marcin",
last: "Warpechowski"
},
address: "Marienplatz 11, Munich",
isActive: "Yes",
Product: {
Description: "Big Mac",
Options: [
{Description: "Big Mac"},
{Description: "Big Mac & Co"}
]
}
}
//more items go here
];Please note that in the above example, the item.Product.Description column has autocomplete options returned by a function defined in the controller.
Whereas item.isActive column has autocomplete options defined directly in the parental scope.
All Handsontable attributes listed here should be supported (namely: width, height, rowHeaders, colHeaders, colWidths, columns, cells, dataSchema, contextMenu, onSelection, onSelectionByProp, onBeforeChange, onChange, onCopyLimit, startRows, startCols, minRows, minCols, maxRows, maxCols, minSpareRows, minSpareCols, multiSelect, fillHandle, undo, outsideClickDeselects, enterBeginsEditing, enterMoves, tabMoves, autoWrapRow, autoWrapCol, copyRowsLimit, copyColsLimit, currentRowClassName, currentColClassName, asyncRendering, stretchH, columnSorting)
This is not considered production ready. When the work is finished, contents of this repo will be submitted into https://github.com/warpech/angular-ui/
