我有一个数组,感谢ng-grid,我可以删除文件:
<div id="myTable" ng-controller="myTable" style="" droppable dropzone drop="handleDrop()">
<div class="gridStyle" ng-grid="gridOptions" >
</div>
</div>
现在,我希望能够从此数组中仅拖动一行,并将其放在我的网页上的另一个数组中。
我试过把enableRowReordering:true,但它没有做任何事情。 我也尝试将draggable放在上面的differefnt div中。它可以工作,但我只能拖动整个数组,而不仅仅是一行。
有什么想法吗? 谢谢!
编辑:gridOptions:
$scope.gridOptions = { //options of the grid
data: 'newResults',
showGroupPanel: false,
selectedItems:$scope.selectedRows, // getting information on the selected row
multiSelect:false,
showSelectionCheckbox:false,
enableRowReordering: true, //enable the drag ???
keepLastSelected: true,
// Event when click on a row
afterSelectionChange:function(data){
if ($scope.selectedRows[0] !== undefined){
console.log("The selected row is : ")
console.log($scope.selectedRows[0].riskalias)
}
},
columnDefs: [{field: 'riskalias', displayName: 'Risk Alias'},
{displayName: 'Options', cellTemplate: '<input type="button" name="view" ng-click="tableView()" value="View"> <input type="button" name="edit" ng-click="tableEdit()" value="Edit"> <input type="button" ng-click="tableDelete(row.entity.name)" name="delete" value="Delete">'}
]
};