## 一个完整的例子
#### HTML part
>页面上引入指令
```js
<zhx-grid options="gridOptions"></zhx-grid>
```
#### module part
>在模块上引入组件模块
```js
var app = angualr.module('myModule',["zhxDataGrid"]);
```
#### Controller part
>在控制器中配置组件配置项
```js
$scope.gridOptions = {
gridData : data,
scope : $scope,
columnDefs : [
{ displayName : "序号", name: "zhxRowNumber" },
{ displayName : "用户名", name: "account", enableSorting: true},
{ displayName : "公司", name: "company", width: 200 },
{ displayName : "入职日期", name: "entryDate",
filter : {
name : "date",
params : ["YYYY-MM-dd HH:mm:ss"]
}
}
],
flexHeight : 220,
sorter : function(order,desc){
$scope.entryDate.orderBy = order;
$scope.entryDate.descOrAsc = desc;
},
paginationConf : {
currentPage: 1,
itemsPerPage: 10,
perPageOptions: [10, 20, 30, 40, 50, 100, 200, 300],
onChange: function () {
$scope.log.pageSize = $scope.gridOptions.paginationConf.itemsPerPage;
$scope.log.pageNum = $scope.gridOptions.paginationConf.currentPage;
}
}
}
```