0
特定の位置に条件ベースでカラムを追加しようとしています。これはコードです。最後の位置にカラム名を追加します...しかし、したいです列 "def"の後に "jkl"列を追加してください...どうすればそれを行いますか?次のコードによって、それが終了位置に列を追加します.....カラム名の間にカラムを挿入します。
$scope.columnNames = [
{field: "abc", displayName: $scope.lable_abc, cellTemplate: '<div class="celltemplate" tooltip="{{row.entity.abc}}" tooltip-append-to-body="true" style="padding-left:10px" > {{row.entity.abc}}<div>'},
{field: "def", displayName: $scope.lable_def, cellTemplate: '<div class="celltemplate" title="{{row.entity.def}}" style="padding-left:10px" > {{row.entity.def}}<div>'},
{field: 'ghi', displayName: $scope.lable_ghi, cellTemplate: '<center><div> <img src="{{row.entity.ghi}}" width="20px" ></div></center>', width: 60},
];
if($scope.x == "2" || $scope.y == "3")
{
$scope.columnNames.push({field: "jkl", displayName: $scope.lable_jkl, cellTemplate: '<div class="celltemplate" title="{{row.entity.jkl}}" style="padding-left:10px" > {{row.entity.jkl}}<div>'});
}
ありがとう@Tushar ...うまく動作します – Samim
あなたは歓迎です:) – Tushar