问题
This is my first Angular project. I'm integrating JqGrid to ngx-admin template. I would like to append an Angular component to a JqGrid column/cell (editAction). I'm passing the component as a string along with data. However, the column appears to be blank.
Is this even possible? Any help would be much appreciated!
var compTypeJQGridDefaults = {
colNames: ['Company Type Name', '', '',],
colModel: [
{
name: 'companyTypeName', index: 'companyTypeName', search: false, width: 100, searchoptions: {
sopt: jqGridSearchOperationsFor.String
},
searchrules: jqGridSearchRulesFor.DefaultMandatory
},
{ name: 'editAction', sortable: false, classes: 'edit', width: 37, search: false, fixed: true,
formatter: function (cellValue){
return cellValue; // "<nb-actions size=\"small\"><nb-action icon=\"save-outline\" (click)=\"onEdit\" nbTooltip=\"Click to update a 'Company Type'.'\" nbTooltipPlacement=\"right\"></nb-action> </nb-actions>"
}
},
{ name: 'deleteAction', sortable: false, classes: 'delete', width: 37, search: false, fixed: true },
],
autoencode: false,
autowidth: true,
shrinkToFit: true,
pager: '#compTypeGridPager',
rowNum: paramFromView.PageSize,
sortname: paramFromView.SortName,
sortorder: paramFromView.SortOrder,
loadBeforeSend: function(jqXHR) {
jqXHR.setRequestHeader("authorization", 'Bearer ' + authToken);
},
url: paramFromView.Url
};
来源:https://stackoverflow.com/questions/59865736/how-to-append-angular-component-to-jqgrids-cell