JS Irontable - A responsive Jquery Table for multiple purposes

Overview

JSIronTable

JS IronTable - A responsive Jquery Table for multiple purposes

This table provides a responsive JQuery table which includes:

  • Column Sorting
  • Fixed header
  • Dynamic data
  • Custom column view
  • Column Rearrange
  • 2D Support for auto rows and columns generation

An example of use is described on the example.js file

var options = {
    data: songs,
    ordering: true,
    fixedheader: true,
    scrollable: true,
    fitHeight: true,
    sortable: true,
    columns: [
        { title: "ID", datafield: "id", visible: false, width: "10%" },        
        { title: "Title", datafield: "title", width: "100px",datafields: [{key: "data-translate", value: "{{lang.main.title}}"}] },
        { title: "Is New", datafield: "isnew", width: "50%" },
        { title: "Duration", datafield: "duration" },
        { title: "Artist", datafield: "artist" },
        { title: "Bpm", datafield: "bpm" },        
        { title: "Path", datafield: "path", visible: false },
        { 
            title: "Actions", 
            datafield: "actions", 
            view: function ( data ) { 
                return '<a href="javascript:ClickActionBtn(\''+data.id+'\');" class="action_icon action_icon_edit"><i class="material-icons">edit</i></a>' 
            }
        },
    ]
};
$('.jsirontable').JSIronTable(options);

It also provides the following Event Listeners

  • OnInitialized() - When the Table has finished loading
  • OnError() - When an Error occurs
  • OnReload() - When the table reloads
  • OnSort() - Gets called after sorting has benn completed
  • BeforeSort() - Gets called before sorting occurs

Example:

var options = {
    data: songs,
    ordering: true,
    fixedheader: true,
    scrollable: true,
    fitHeight: true,
    sortable: true,
    columns: [
        { title: "ID", datafield: "id", visible: false, width: "10%" },        
        { title: "Title", datafield: "title", width: "100px",datafields: [{key: "data-translate", value: "{{lang.main.title}}"}] },
        { title: "Is New", datafield: "isnew", width: "50%" },
        { title: "Duration", datafield: "duration" },
        { title: "Artist", datafield: "artist" },
        { title: "Bpm", datafield: "bpm" },        
        { title: "Path", datafield: "path", visible: false },
        { 
            title: "Actions", 
            datafield: "actions", 
            view: function ( data ) { 
                return '<a href="javascript:ClickActionBtn(\''+data.id+'\');" class="action_icon action_icon_edit"><i class="material-icons">edit</i></a>' 
            }
        },
    ],
    OnInitialized: function()
    {
        console.log("Initialized");
    },
    OnError: function(error)
    {
        console.log(error);
    }
};

var jsirontable = $('.jsirontable').JSIronTable(options);

or declaring them in a later state

jsirontable.OnInitialized(function() {
});

jsirontable.OnError(function(error) {
});

jsirontable.OnReload(function() {
});

jsirontable.OnSort(function() {
});

jsirontable.BeforeSort(function() {
});

An 2D example to create columns and rows from the data itself with a unique BPM for each artist

var {    
    data: songs,
    nodatatext: "No Entries here",
    nodata_datafields: [{key: "data-translate", value: "{{lang.main.title}}"}],
    scrollable: true,
    fitHeight: true,
    fixedheader: true,
    sortable: false,
    draggableColumns: false,
    headerfontsize: "8pt",
    cellfontsize: "8pt",
    rowPerUniqueValue: {
        datafield: "bpm", 
        sortCompare: function (a,b) { return b-a; } // numeric reverse sort
    },
    columns: [
        { 
            title: "BPM",
            datafield: "bpm",
            visible: true,
        },        
        { 
            fromUniqueValues: {
                datafield: "artist", 
                sortCompare: function(a,b) { return a.localeCompare(b);} // alpha sort
            },
            view: function ( data ) { 
                return  1;
            },
            combineValues: function ( dataList ) {
                return dataList.length
            }
        }
    ]
};
$('.jsirontable').JSIronTable(options);

More updates and fixes coming soon..

You might also like...

Providing a complete list of Kurdish (ckb) Alphabet for developing purposes

Providing complete information on Arabic-based Kurdish Alphabets (CKB) Kurdish Alphabet Arabic-based Kurdish Characters Character Unicode Code Point N

Aug 6, 2022

This is a little script that shows how to ddos a website. This is for example purposes only. Don't ddos a website without the consent of his owner

Dddos-Script This is a little script to ddos a website. This is for example purposes only. I am not responsable of what you do with it If you like thi

Dec 17, 2022

A modern, clean design can be customized and applied for a wide range of purposes

Gatsby starter for projects portfolio with Flotiq source Kick off your project with this hello-world boilerplate. This starter ships with the main Gat

Oct 4, 2022

An exercise in building a very minimal (and very stupid) in-memory SQL-like database for educational purposes.

Stupid Database This is an exercise in building a very minimal (and very stupid) in-memory SQL-like database for educational purposes. None of this co

Dec 20, 2022

A simple NFT trading and breeding platform for demonstration purposes.

A simple NFT trading and breeding platform for demonstration purposes.

📦 boxyz I know it sounds strange, but maybe these boxes can breed and have children. They can be sold as well. boxyz is a fun project to trade and br

Dec 12, 2022

Elven Tools Dapp - Elrond blockckchain frontend dapp demo. Primarily for NFT minting, but it can be used for other purposes.

Elven Tools Dapp Docs: elven.tools/docs/landing-page.html Demo: dapp-demo.elven.tools Sneak peek: youtu.be/ATSxD3mD4dc The Dapp is built using Nextjs

Jan 1, 2023

Minecraft 1.8.9 mod which steals the access token and more things from the targetted user and sends to a backend server for processing. Disclaimer: For educational purposes only.

Minecraft 1.8.9 mod which steals the access token and more things from the targetted user and sends to a backend server for processing. Disclaimer: For educational purposes only.

R.A.T Retrieve Access Token Check DxxxxY/TokenAuth to login into an MC account with a name, token and uuid combo. Features Grabs the username, uuid, t

Jan 9, 2023

In our last repo we learnt how to create a DAO on your own and how to use governance tokens and NFTs for voting purposes.

In our last repo we learnt how to create a DAO on your own and how to use governance tokens and NFTs for voting purposes.

In our last repo we learnt how to create a DAO on your own and how to use governance tokens and NFTs for voting purposes. Now we will be stepping into the world of games with NFTs where a user has to play games with their character being an NFT which has unique powers, unique traits etc etc.

Oct 1, 2022
Comments
  • add 2d table support

    add 2d table support

    Hi raftopyannis,

    First, thanks for creating jsirontable, it was exactly the kind of library I was looking for in terms of table creation from json data.

    But one thing I was after was the ability to create columns and rows from the data itself - a "2d" table.

    I see there's been no commits to jsirontable (or any other activity on your github account) for 8 months, but I'm hoping you are still out there somewhere and get a notification of this PR.

    Please accept a pull request to add 2d table capability. I've added an example to the example page which creates a table of the number of tracks each artist has at each unique BPM value (just something contrived to use the facilities with the existing data).

    Hopefully you like it, I've tried to keep the implementation as similar to existing code as possible, resisted any urge to refactor the code in any way, and make the number of changes as small and self-contained as possible to ease PR. The changes should also mean that no existing functionality should be affected.

    If you are generally supportive, I'd love to hear back and then I'll spend some more time testing, and implementing any suggestions you may have.

    Regards

    opened by Kolossi 2
Owner
Raftopoulos Yannis
Experienced all-round Software Engineer and a passionate Game Developer and Designer.
Raftopoulos Yannis
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
✏️ A small jQuery extension to turn a static HTML table into an editable one. For quickly populating a small table with JSON data, letting the user modify it with validation, and then getting JSON data back out.

jquery-editable-table A small jQuery extension to turn an HTML table editable for fast data entry and validation Demo ?? https://jsfiddle.net/torrobin

Tor 7 Jul 31, 2022
Another table select prompt plugin of inquirer.js, with powerful table render and filters.

inquirer-table-select-prompt Table row selection prompt for Inquirer.js 动机 现有的 inquirer.js 没有支持表格行选中的命令行交互的插件. 社区内能查找到的,只有一个二维数组的 checkbox,eduardobouc

锂电 3 Jan 7, 2023
Responsive Tabs is a jQuery plugin that provides responsive tab functionality.

Responsive Tabs is a jQuery plugin that provides responsive tab functionality. The tabs transform to an accordion when it reaches a CSS breakpoint. You can use this plugin as a solution for displaying tabs elegantly on desktop, tablet and mobile.

Jelle Kralt 537 Dec 8, 2022
jQuery filter for all purposes.

jQuery EasyFilter The easiest way to filter anything! How to use 1. Include jQuery (ignore this if you have already included on the page). <script src

Rafael F. da Silva 2 Jun 17, 2022
True P2P concept for your p2p powered website/app/client. MSC/MEP (Multiple Strategy Concept/Multiple Entry Points)

TRUE P2P CONCEPT - Lets redecentralize the web This repo is just conceptual. Active development of the endproduct (TRUE P2P) happens here https://gith

Bo 6 Mar 29, 2022
⚡🚀 Call multiple view functions, from multiple Smart Contracts, in a single RPC query!

ethers-multicall ⚡ ?? Call multiple view functions, from multiple Smart Contracts, in a single RPC query! Querying an RPC endpoint can be very costly

Morpho Labs 20 Dec 30, 2022
jQuery plugin to generate a table of contents

jquery.contentify A jQuery plugin to generate a table of contents Usage The below code snippet shows how to create the table of contents in a containe

Johannes Marbach 1 Aug 24, 2021
Creates a table of contents in a DOM element optionally linked to with anchors. No jQuery or other dependencies.

HTML-Contents Creates a table of contents in a DOM element optionally linked to with anchors. No dependencies. @psalmody Get It We're on npm: npm i ht

Michael Tallino 3 Oct 25, 2022