Is it possible to have a select drop down inside of the AngularJS ng-grid?

后端 未结 4 977
广开言路
广开言路 2021-02-04 12:34

I have coded the following:

$scope.gridOptions = {
    data: \'myData\',
    enableCellEdit: true,
    multiSelect: false,
    columnDefs: [
        { field: \'I         


        
4条回答
  •  醉酒成梦
    2021-02-04 13:22

    The way tosh shimayama are doing it, will not allow for sorting the table in any other order than the model array.

    This is kind of an ugly way to do it, but I took a quick look in the source code for ng-grid and found that they use regexp to insert the ng-model. So by using the same variable, COL_FIELD, in your code you can make ng-grid insert the correct model.

    Here is a plunker with a working example: http://plnkr.co/edit/Yj2qmI?p=preview

提交回复
热议问题