Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. * @hidden
  3. */
  4. @Output()
  5. protected onDensityChanged = new EventEmitter<any>();
  6.  
  7. @Input()
  8. public get displayDensity(): DisplayDensity | string {
  9.     return this._displayDensity;
  10. }
  11.  
  12. /**
  13. * Sets the display density currently applied to the grid.
  14. * ```html
  15. * <igx-grid #grid [data]="localData" [displayDensity]="'compact'" [autoGenerate]="true"></igx-grid>
  16. * ```
  17. * @memberof IgxGridComponent
  18. */
  19. public set displayDensity(val: DisplayDensity | string) {
  20.     switch (val) {
  21.         case 'compact':
  22.             this._displayDensity = DisplayDensity.compact;
  23.             break;
  24.         case 'cosy':
  25.             this._displayDensity = DisplayDensity.cosy;
  26.             break;
  27.         case 'comfortable':
  28.         default:
  29.             this._displayDensity = DisplayDensity.comfortable;
  30.         }
  31.      this.onDensityChanged.emit();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement