0
내 테이블에 사용자 지정 열을 만들어야 동작을 수행 할 수 있고 행을 정의하는 개체에 따라 html 코드를 생성해야합니다.행 개체 데이터 및 html로 열 만들기
저는 각도에 익숙하지 않고 $ compile을 사용해야한다고 생각합니다. 그러나 어떻게해야할지 모르겠습니다.
열 정의 :
이vm.dtColumns = [
DTColumnBuilder.newColumn('name').withTitle("Name"),
DTColumnBuilder.newColumn(null).withTitle("Actions").notSortable()
.renderWith(function(data, type, full, meta) {
//imported code from a previous version where the code was generated from a ng-repeat directive
//project is the object, which can be found in the full parameter of the function
var html = '<button data-toggle="modal" data-target="#archiveProjectModal" type="button" class="btn btn-success col-sm-10 col-sm-offset-1" ng-if="project.active"><i class="fa fa-check"> </i>Archiver</button>'
+ '<a href="/project/{{project.id}}" type="button" class="btn btn-primary col-sm-10 col-sm-offset-1"><i class="fa fa-pencil"> </i>Mettre à jour</a>'
+ '<button data-toggle="modal" data-target="#deleteProjectModal" type="button" class="btn btn-danger col-xs-10 col-xs-offset-1"><i class="fa fa-trash"> </i>Supprimer</button>'
//what should i return ?
return "?";
}),
];
누군가가 나를 도울 수 있습니까?