我的ui网格中有一个包含文本字段的列。我需要列的最后两个单元格包含一个dropbox。我不知道如何以最好的方式做到这一点。我正在为网格中的网格和数据使用bootstrap和angularjs。
这是我在html文件中声明网格的地方:
<div class="modal-body">
<div id="gridTest" ui-grid="gridOptions" class="grid"></div>
</div>
我在这里设置列的数据和我正在讨论的列的文本字段:
$scope.gridOptions = {
showGridFooter: true,
enableHorizontalScrollbar: 0,
showColumnFooter: false,
enableFiltering: false,
enableColumnMenus: false,
enableGridMenu: false,
columnDefs: [
{ field: 'empty', width: '34%', displayName: ''},
{ field: 'modified', width: '34%', displayName: 'Modified', cellTemplate: '<input class="text-test" type="text">'},
{ field: 'original', width: '34%', displayName: 'Originals', cellTemplate: '<div style="text-align:center">{{COL_FIELD CUSTOM_FILTERS}}</div>'},
],
data: [
{
"empty":"Number of Employees(Daily)",
"modified": "",
"original":"20",
},
{
"empty":"Customer Restroom Visits(Daily)",
"modified":"",
"original":"5",
},
{
"empty":"Days Open per Week",
"modified":"",
"original":"5",
},
{
"empty":"Number of Restrooms",
"modified":"",
"original":"2",
},
{
"empty":"Number of Stalls",
"modified":"",
"original":"2",
},
{
"empty":"Number of Urinals",
"modified":"",
"original":"2",
},
{
"empty":"Delivery Frequency",
"modified":"",
"original":"Weekly Deliveries",
},
{
"empty":"Billing Frequency",
"modified":"",
"original":"Monthly",
}
],
onRegisterApi: function(gridApi) {
$scope.gridApi = gridApi;
}
};
有没有办法可以将列中的每个单元格设置为自己的字段?以及如何在列中的2个单元格的下拉菜单中添加?
我是新手,所以任何其他信息请告诉我,谢谢!