Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/leandrosardi/selectrowsjs

JavaScript library for handling the rows selection of an HTML table.
https://github.com/leandrosardi/selectrowsjs

javascript javascript-library row rowselection selection-sort table tables tableview

Last synced: about 1 month ago
JSON representation

JavaScript library for handling the rows selection of an HTML table.

Awesome Lists containing this project

README

        

![GitHub issues](https://img.shields.io/github/issues/leandrosardi/selectrowsjs) ![GitHub](https://img.shields.io/github/license/leandrosardi/selectrowsjs) ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/leandrosardi/selectrowsjs) ![GitHub last commit](https://img.shields.io/github/last-commit/leandrosardi/selectrowsjs)

# SelectRows.Js

The **SelectRows.Js** is a JavaScript library for handling the rows selection of an HTML table.

[Find a live example here](https://connectionsphere.com/selectrowsjs).

**>>>> IF YOU LIKE THIS PROJECT, STAR IT ! <<<<**

**Outline:**

1. [Getting Started](#1-getting-started).
2. [Enabling / Disabling Buttons](#2-enabling--disabling-buttons).
3. [Using SelectRows.Js as a MySaaS Extension](#3-using-selectrowsjs-as-a-mysaas-extension).

## 1. Getting Started

Get started in 3 simple steps.

**Step 1.** Download the libraries `jquery-3.5.1.min.js` and `selectrows.min.js`. You can download them from this page.

**Step 2.** Include the file of your HTML page.

```html

```

**Step 3.** Create your table with rows selection.

**Example:**

```html






Name

...











...

// call the function init when the page is loaded.
selectRowsJs.init();

```

## 2. Enabling / Disabling Buttons

Some buttons in your screen may require one or more rows are selected.

Add the tag `data-rows-group-id='users'` on the buttons and checkboxes, in order to link all of them together.

**E.g.:**

```html





...
```

```html





...
```

## 3. Using SelectRows.Js as a [MySaaS](https://github.com/leandrosardi/mysaas) Extension

If you are running a [MySaaS](https://github.com/leandrosardi/mysaas) project, you can add **SelectRows.js** as an extension.

Such an extension includes a code example screen (`/selectrowsjs`) that you show to other developers, for reference.

Install **SelectRows.js** as an extension of [MySaaS](https://github.com/leandrosardi/mysaas) is pretty simple.

**Step 1:** Clone the project in the `extensions` filder.

```bash
cd ~/code/mysaas/extensions
git clone https://github.com/leandrosardi/selectrowsjs
```

**Step 2:** Add the extension to your `config.rb` file.

```ruby
BlackStack::Extensions.append :selectrowsjs
```