primeng

How to create print method in primeNg table

夙愿已清 提交于 2020-01-25 10:17:12
问题 In my angular project, I used a table of PrimeNg and I want to print all data and selected data of this table I don't know how I do it so if there any way or method to handle it? my template <div class="mainTbl"> <p-table #filterT [columns]="cols" [value]="clients" [scrollable]="true" [paginator]="false" [rows]="2" scrollHeight="200px" [resizableColumns]="false"> <ng-template pTemplate="colgroup" let-columns> <colgroup> <col *ngFor="let col of columns" > </colgroup> </ng-template> <ng

Primeng table filter not working on column with nested object

南楼画角 提交于 2020-01-25 07:05:46
问题 I have a primeng table where on column value is obtained from a nested object.I am unable to filter the table using that column value.The filter works fine if enter value present in other columns.Please help.Thanks in advance. Here is my typescript: this.cols = [ { field: 'name', header: 'Name' }, { field: 'email', header: 'Email' }, { field: 'phnNumber', header: 'Contact No' }, { field: 'grades[0].grade1', header: 'Grade' }, ]; here is my filter: <div class="col-md-6"> <p-table [columns]=

Primeng table filter not working on column with nested object

瘦欲@ 提交于 2020-01-25 07:04:58
问题 I have a primeng table where on column value is obtained from a nested object.I am unable to filter the table using that column value.The filter works fine if enter value present in other columns.Please help.Thanks in advance. Here is my typescript: this.cols = [ { field: 'name', header: 'Name' }, { field: 'email', header: 'Email' }, { field: 'phnNumber', header: 'Contact No' }, { field: 'grades[0].grade1', header: 'Grade' }, ]; here is my filter: <div class="col-md-6"> <p-table [columns]=

How to export my json data into pdf,excel using angular 2

不羁岁月 提交于 2020-01-21 04:51:25
问题 I have created my Data table from the angular 2 website. Now I want to export my json data to PDF,excel using angular 2 framework. Kindly give me suggestion how can I achieve that or any link if you have. Regards 回答1: Use jsPDF to convert from JSON to PDF. And AlaSQL to convert from JSON to Excel (*.xls, *.xlsx). 回答2: (function () { 'use strict'; angular.module('ngJsonExportExcel', []) .directive('ngJsonExportExcel', function () { return { restrict: 'AE', scope: { data : '=', filename: '=?',

PrimeNG schedule custom buttons

自作多情 提交于 2020-01-17 05:51:07
问题 Can use full calendar custom buttons in PrimeNG Schedule component? I've tried to use ElementRef by @ViewChild("calendar-id"), but I get p-shedule object type, without any fullCalendar methods. customButtons: { myCustomButton: { text: 'custom!', click: function() { alert('clicked the custom button!'); } } }, Custom buttons docs PrimeNG schedule docs 回答1: The best way to do it today is make your own buttons. It can be done with ElementRef of your calendar @ViewChild("calendar-id"). @ViewChild(

How to always open PrimeNg's p-calendar on today's date

流过昼夜 提交于 2020-01-16 19:58:06
问题 ''I am using PrimeNg's calendar in my Angular Application. I am using multiple selectionMode and binding the calendar to an array of dates from the database. The calendar starts on the latest date in the range from the database but I want it to always start off with today's date and then the user can navigate backwards and forwards to see the previously selected dates from the database. I set the defaultDate but it doesn't make any difference. Please help. Thanks, my html: <p-calendar [

how to bind auto-complete selected value to form Control Name

ⅰ亾dé卋堺 提交于 2020-01-16 08:20:13
问题 I'm having an Angular(6) reactive form with a (prime-ng) autocomplete control. I'm managing to populate it correctly with values (of streets), but I'm missing something when trying to bind the streetID (and not street name) to the form control. I tried to use the value attribute, but it still didn't fixed it. See my Html code: <div class="form-group"> <label>Street <p-autoComplete formControlName="StreetID" [dropdown]="true" [suggestions]="autoCompleteStreetsNames" (completeMethod)=

Editing CSS for PrimeNG Components

别说谁变了你拦得住时间么 提交于 2020-01-13 07:05:47
问题 I am currently developing a user interface using Angular 4, Angular Materials and PrimeNG components. The latest component I am battling with is the MultiSelect Component from PrimeNG: https://www.primefaces.org/primeng/#/multiselect I am simply just trying to make the component's width fit 100% of the parent component. Is there a specific process I need to follow to edit CSS classes for this component? The documentation says to use "Style" for inline - does this mean: <p-multiSelect [options

Editing CSS for PrimeNG Components

浪尽此生 提交于 2020-01-13 07:05:10
问题 I am currently developing a user interface using Angular 4, Angular Materials and PrimeNG components. The latest component I am battling with is the MultiSelect Component from PrimeNG: https://www.primefaces.org/primeng/#/multiselect I am simply just trying to make the component's width fit 100% of the parent component. Is there a specific process I need to follow to edit CSS classes for this component? The documentation says to use "Style" for inline - does this mean: <p-multiSelect [options

PrimeNG manually invoke FileUpload

元气小坏坏 提交于 2020-01-10 04:57:25
问题 I want to select the files first and then to start upload those files by an another button instead of component's own Upload button. How can I do this? Example code what I've tried: <button pButton type="button" label="Start Upload" (click)="startUpload()"></button> <p-fileUpload #fileInput name="fileIcon" url="rest/batch/file/multimedia/"></p-fileUpload> @ViewChild('fileInput') fileInput:ElementRef; constructor( private renderer: Renderer ) { } startUpload(){ // this.fileInput.upload(); ->