角度-uiグリッドの行を選択し、その行をクリップボードにコピーしたいとします。角度uiグリッドで行を選択するときに表示される列のみを取得する
これは私のコードです:
$scope.copySelection = function() {
$scope.retainSelection = $scope.gridApi.selection.getSelectedRows();
alert(JSON.stringify($scope.retainSelection));
var input = document.createElement("input");
input.type = "text";
document.getElementsByTagName('body')[0].appendChild(input);
input.value = JSON.stringify($scope.retainSelection);
input.select();
document.execCommand("copy");
input.hidden = true;
$scope.gridApi.selection.clearSelectedRows();
};
Plunker:http://plnkr.co/edit/dcj7DUWHyA3u1bouxRhI?p=preview
しかし、私はちょうど目に見える列をコピーしたいが、私はJSONにあるすべての列を取得しています。私は隠しコラムがほしくない。それ、どうやったら出来るの?助けてください。
あなたはフィドルを追加できますか? –
@MuhammedNeswine私は私の質問を編集しました –