Posts

Showing posts from May, 2020

Recent

Kendo Grid Pdf Export External

https://stackblitz.com/edit/ng-kendo-grid-pdf-export-external-kk-12?embed=1&file=app/app.component.ts&view=preview import   {   Component ,   ViewEncapsulation   }   from   '@angular/core' ; import   {   GridDataResult ,   PageChangeEvent ,   GridComponent   }   from   '@progress/kendo-angular-grid' ; import   {   ViewChild   }   from   '@angular/core' ; import   {   ExcelExportData   }   from   '@progress/kendo-angular-excel-export' ; import   {   SortDescriptor ,  process ,   GroupDescriptor ,  aggregateBy ,   CompositeFilterDescriptor   }   from   '@progress/kendo-data-query' ; @ Component ({   selector :   'my-app' ,    /*    * Set a fixed row height of 36px (20px line height, 2 * 8px padding)    *    * [row height] = [line height] + [padding] + [border]    *    * Note: If using the Kendo UI Material theme, add 1px to the row height    * to account for the bottom border width.    */   encapsulation :   ViewEncapsulation . None

Kendo Grid Pdf Export multi grid

https://stackblitz.com/edit/ng-multi-kendo-grid-export-kk-12?embed=1&file=app/app.component.ts&view=preview import   { Component ,   ViewEncapsulation , ViewChildren ,   QueryList , AfterViewInit }   from   "@angular/core" ; import   {   GridComponent   }   from   "@progress/kendo-angular-grid" ; import   {  exportPDF ,   Group   }   from   "@progress/kendo-drawing" ; import   {  saveAs  }   from   "@progress/kendo-file-saver" ; import   {  products  }   from   "./products" ; @ Component ({   selector :   "my-app" ,   template :   `     <button type="button" class="k-button" (click)="exportGrids()">       Export     </button>     <kendo-grid       class="zen-pdf-export-grid"       [kendoGridBinding]="products1"       [pageable]="true"       [pageSize]="10"       [height]="430"     >       <kendo-grid-column field="

Kendo Grid Pdf Export

https://stackblitz.com/edit/ng-kendo-grid-export-pdf-kk-12?embed=1&file=app/app.component.ts&view=preview import   {   Component   }   from   '@angular/core' ; import   {  products  }   from   './products' ; @ Component ({     selector :   'my-app' ,     template :   `         <kendo-grid           [data]="gridData"           [height]="410"           [rowClass]="rowClass">             <ng-template kendoGridToolbarTemplate>                 <button kendoGridPDFCommand icon="file-pdf">Export to PDF</button>             </ng-template>             <kendo-grid-column field="ProductID" title="ID" width="40">             </kendo-grid-column>             <kendo-grid-column field="ProductName" title="Name" width="250">             </kendo-grid-column>             <kendo-grid-column field="Category.Categor

Sort array of objects by key

/*      !Sort array of objects by key      =======================================      Implementation:                      arrayObj  = [{name:"james",sortOrder: 2},{name:"john",sortOrder: 1}];                      arrayObj.sort((a, b) => sortArrayObjByKey(a, b, 'sortOrder'));                      //* Output: [{name:"john",sortOrder: 1}{name:"james",sortOrder: 2}]   */    sortArrayObjByKey ( a :  any ,  b :  any ,  key :  string ) {      return   a [ key ] -  b [ key ];   }

Merge two array of objects, removes duplicate objects

/*      !Merge two array of objects, removes duplicate objects      =======================================      Implementation:                      arrayObj1  = [{name:"a"},{name:"b"}];                      arrayObj2  = [{name:"a"},{name:"c"}];                      mergedArrayObj = uniqueMergeArrayObj(arrayObj1, arrayObj2);                     //* Output: [{name:"a"},{name:"b"},{name:"c"}]   */    uniqueMergeArrayObj ( arr1 :  any [],  arr2 ?:  any []) {      const   duplicateArray  = [... arr1 , ... arr2 ];      return  [... new   Set ( duplicateArray . map ( o   =>   JSON . stringify ( o )))]. map ( s   =>   JSON . parse ( s ));   }