Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-switchable-grid

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-switchable-grid

[![npm version](https://badge.fury.io/js/angular-switchable-grid.svg)](https://badge.fury.io/js/angular-switchable-grid) [![npm all downloads](https://img.shields.io/npm/dt/angular-switchable-grid.svg)](https://badge.fury.io/js/angular-switchable-grid) [!

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Angular Switchable Grid

npm version npm all downloads npm week downloads npm month downloads npm  year downloads npm license

A simple grid for angular, Which can be switched between typical List view and a tile block view

Demo

https://sanuradhag.github.io/angular-switchable-grid/

Installation

Install through npm;

npm install --save angular-switchable-grid

Then import GridModule and include it in your apps for module.

import { Component, NgModule } from '@angular/core';
import { GridModule } from 'angular-switchable-grid';
 
@NgModule({
  imports: [
    GridModule
  ]
})
export class MyModule {}

Then add angular-switchable-grid to your app template.

<angular-switchable-grid
  [data]="data"
  [columns]="columnTitles"
  [enableSelection]="true"
  [enableMultiSelect]="true"
  [filterBy]="'first_name'"
  [filterTerm]="filterTerm"
  [enableSort]="true"
  [isGridView]="isGridView"
  [noDataTemplate]="null"
  (getSelectedItems)="getSelectedItems($event)">

  <ng-template let-item>
    <div>{{item.id}}</div>
    <div>{{item.first_name}}</div>
    <div>{{item.last_name}}</div>
    <div>{{item.email}}</div>
    <div>{{item.gender}}</div>
    <div>{{item.ip_address}}</div>
  </ng-template>

</angular-switchable-grid>

Styles

Style guide will be added soon.

Documentation

angular-switchable-grid properties.
PropertyInput/OutputDefault valueDescription
[data]Input[] - empty arrayThe data to be displayed in the grid.
[columns]Input[] - empty arrayTitles of the columns in the grid. Type should be Array<{ property: string, displayName: string, width?: string }>
[enableSelection]InputfalseEnable the selection of the rows of the grid.
[enableMultiSelect]InputfalseEnable the multiple selection of the rows of the grid.
[filterBy]Input'' - empty stringGrid will be filtered by this key.
[filterTerm]Input'' - empty stringGrid will filter its's content by the filterBy and will display only the items which are similar to the this.
[enableSort]InputfalseEnables sorting in the grid
[enablePagination]InputfalseEnables pagination in the grid
[isGridView]InputfalseIf sets to true, Grid's view will be changed to Tile view from List view.
[noDataTemplate]InputSimple text 'No Data'The template that will be displayed when there is no data.
(getSelectedItems)Output[] - empty arrayWill emit the selected items when user is selecting items from the grid.

And should pass a template for the row template.

 <ng-template let-item>
        <div>{{item.id}}</div>
        <div>{{item.first_name}}</div>
        <div>{{item.last_name}}</div>
        <div>{{item.email}}</div>
        <div>{{item.gender}}</div>
        <div>{{item.ip_address}}</div>
 </ng-template>
 

Public methods that can be used to access features of the grid.

exportAsExcelFile() - Export the grid data to a excel file.
selectAll() - Select all the items in the grid.
deselectAll() - Deselect all selected item in the grid.

ToDo

  • Grid pagination.
  • Lazy loading.

Any suggestions?

Drop me a e-mail saggunasekara@gmail.com.

Or open a new issue in https://github.com/sanuradhag/angular-switchable-grid/issues

Contributors


Anuradha Gunasekara

Brion Mario

License

This software is licensed under the MIT license

Keywords

FAQs

Package last updated on 04 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc