Giter Site home page Giter Site logo

mladenknezevic2011 / bootstable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from t-edson/bootstable

0.0 0.0 0.0 159 KB

Javascript library to make HMTL tables editable, using Bootstrap

License: GNU General Public License v3.0

JavaScript 100.00%

bootstable's Introduction

Donate to the project

paypal

Bootstable

Javascript library to make HMTL tables editable, using Bootstrap

Bootstable

"Bootstable" is a javascript library (plug-in), that lets convert a HTML static table to a editable table. A table is made editable, including several buttons to perform the edition actions.

Edition options includes:

  • Edit fields.
  • Remove rows.
  • Add rows. (require and aditional button)

Dependencies:

  • Jquery
  • Bootstrap

Bootstrap is necessary to format correctly the controls used, and to draw icons.

No database connection is included. The library was designed to work offline, when editing.

Examples:

Sets all the columns of #mytable editable:

  $('#mytable').SetEditable();

Sets the columns 0 and 1 of #mytable editable:

  $('#mytable').SetEditable({
                columnsEd: "0,1" //editable columns
  });

Includes a "New row" button:

  $('#mytable').SetEditable({
                columnsEd: "0,1",
                $addButton: $('#but_add')
  });

IMPORTANT: Bootstable need the ID of the table to edit, and can only work on a single table.

  $('.mytable').SetEditable();  //BAD! No class reference allowed.
  $('table').SetEditable();     //BAD! No several tables allowed.

If several tables need to be editable in a same Web page, it's needed to set each table:

  $('#mytable1').SetEditable();
  $('#mytable2').SetEditable();

LIMITATION: When using several editable tables, events won't work properly.

Parameters:

    columnsEd: null,         //Index to editable columns. If null all td editables. Ex.: "1,2,3,4,5"
    $addButton: null,        //Jquery object of "Add" button
    onEdit: function() {},   //Called after edition
    onBeforeDelete: function() {}, //Called before deletion
    onDelete: function() {}, //Called after deletion
    onAdd: function() {},     //Called when added a new row
    $addColButton : null, // Jquery object of "Add Column Button"
    onAddCol : function() {} // Called after adding new column

bootstable's People

Contributors

t-edson 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.