Git Product home page Git Product logo

paginated-table's Introduction

Paginated Table

Codacy Badge

Table of Contents

Overview

Demo site can be found here. This has been a fun project to work on so far.

Built With

How To Run Code Locally

To clone and run this application, you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:

# Clone this repository
$ git clone https://github.com/EstherSeyi/paginated-table.git

# Install dependencies
$ npm i

# Run the app
$ npm run start

How does this work

  • On the browser After running code locally or navigating to the demo site;

    1. Click on Next button to load and view next set of data and Previous to go back.
    2. Current page number is displayed beside the next and previous buttons.
  • On the codebase

    • The helpers folder contains the;

      1. display-table file which exports the displayTableData(data, tableRef, init) function. This function displays and updates the rows of the table based on data provided to it. This functions accepts two compulsory(the data and tableRef) and one optional argument (an boolean which says if the function is being called on initial load or on click of the navigation buttons).

      2. fetch file which abtracts the fetching operation. It fetches data based on the config detail provided. It also handles fetching activies like error sand loading situations. It takes five arguments the request url, onSuccess, onError, onLoad and stopLoad handlers.

    • The types folder contains the types file which returns User and Data types.

    • The app.ts file contain all the relevant operations including the initial fetch, the next and previous click event handlers.

Contact

paginated-table's People

Contributors

estherseyi avatar

Stargazers

Roman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.