Posts

Showing posts from 2020

Recent

Custom Controls Using Angular Material

Git Repo:  https://github.com/yawahang/ohcontrols Features DatePicker (Date Picker, Time Picker, Date Time Picker, and many more) RatingPicker (Vertical, Horizontal, Custom Icons) Select (Single Select, MultiSelect, Single Column, MultiColumn) Recursive Treeview

Compress Json using CJson (Asp.Net Core, Angular)

Git Repo:  https://github.com/yawahang/cjson Git Project:  https://github.com/users/yawahang/projects/2 SfJsonToCjson.sql:  https://drive.google.com/file/d/1Y18b7rjTd8OjzOSPyy3nxisjcPMCN2OZ/view CJson_Test.sql:  https://drive.google.com/file/d/1qI7poe47KG-YyMDDmlU_XpYI1L0c4zx2/view?usp=sharing CJson is used to compress Json (avg 30% to 40%) by separating keys and values into two different sections eliminating the duplicate keys and reducing the Json size. Released to the public domain By Steve Hanov.

Basic Flutter Sample Project

Git Repo:  https://github.com/yawahang/flutter_test Git Project:  https://github.com/users/yawahang/projects/1

Sales Transaction Project (Asp.Net Core, Ado.net, Angular)

  Git Repo:   https://github.com/yawahang/sales_transaction Basic Login. Database connection and CRUD using Ado.Net. Api project and basic settings. Basic Angular project with .net core. Lazy loaded routes. Angular Material basic components implementation.

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 ));   }