All Projects → GrumpyCockatiel → Raytools

GrumpyCockatiel / Raytools

Licence: mit
A very simple lightweight jQuery Data Grid table that uses jQuery & Bootstrap.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Raytools

Bs grid
Bootstrap Datagrid
Stars: ✭ 184 (+3580%)
Mutual labels:  datagrid, bootstrap, jquery
Aurelia Slickgrid
Aurelia-Slickgrid a wrapper of the lightning fast & customizable SlickGrid datagrid with a few Styling Themes
Stars: ✭ 100 (+1900%)
Mutual labels:  datagrid, bootstrap, jquery
Bootstrap Submenu
Bootstrap sub-menus
Stars: ✭ 442 (+8740%)
Mutual labels:  bootstrap, jquery
Sco.js
Javascript extensions for twitter bootstrap
Stars: ✭ 465 (+9200%)
Mutual labels:  bootstrap, jquery
Bootstrap Fileinput
An enhanced HTML 5 file input for Bootstrap 5.x/4.x./3.x with file preview, multiple selection, and more features.
Stars: ✭ 5,097 (+101840%)
Mutual labels:  bootstrap, jquery
Bootstrap Iconpicker
A simple icon picker
Stars: ✭ 344 (+6780%)
Mutual labels:  bootstrap, jquery
Web
适合java新手入门练习的java web个人网站项目,目前主要维护web-mysql和web-psql两个分支。前台包括博客、代码库、文件下载、留言、登录注册、站内搜索、分类目录等功能,后台包括上传文件、博客、代码,编辑、删除文章,修改个人资料等功能,目前暂停开发新功能。网址:https://demo.hemingsheng.cn ,觉得不错的欢迎 star。 手机版网址:
Stars: ✭ 414 (+8180%)
Mutual labels:  bootstrap, jquery
Jtsage Datebox
A multi-mode date and time picker for Bootstrap (3&4), jQueryMobile, Foundation, Bulma, FomanticUI, and UIKit (or others)
Stars: ✭ 481 (+9520%)
Mutual labels:  bootstrap, jquery
Angular Slickgrid
Angular-Slickgrid is a wrapper of the lightning fast & customizable SlickGrid datagrid, it also includes multiple Styling Themes
Stars: ✭ 298 (+5860%)
Mutual labels:  datagrid, jquery
Mobirise
Free Website Builder for Bootstrap 4 & AMP
Stars: ✭ 664 (+13180%)
Mutual labels:  bootstrap, jquery
Jquery Smartwizard
The awesome jQuery step wizard plugin
Stars: ✭ 635 (+12600%)
Mutual labels:  bootstrap, jquery
Javaquarkbbs
基于Spring Boot实现的一个简易的Java社区
Stars: ✭ 755 (+15000%)
Mutual labels:  bootstrap, jquery
Wondercms
WonderCMS - fast and small flat file CMS (5 files)
Stars: ✭ 330 (+6500%)
Mutual labels:  bootstrap, jquery
Roncoo Adminlte
RonCoo AdminLTE --是一个完全响应式的免费开源后台管理模板。基于 AdminLTE 框架(后续会随着版本更新而更新);使用jQuery 2.2.3版本,并引入很多优秀的第三方jQuery插件,开发者也可以改用自己熟悉的第三方插件,易于使用,并高度可定制,适合许多屏幕分辨率从小型移动设备到大型台式机,这是国内的开源模板未支持的。
Stars: ✭ 320 (+6300%)
Mutual labels:  bootstrap, jquery
Gijgo
Gijgo - Free Javascript Controls
Stars: ✭ 424 (+8380%)
Mutual labels:  datagrid, jquery
Bootstrap Rating Input
Another plugin that eases the generation of rating stars for jQuery and Bootstrap
Stars: ✭ 318 (+6260%)
Mutual labels:  bootstrap, jquery
Bugcatcher
方便产品、开发、测试三方协同管理、测试、监控项目进度和质量,以持续交付。
Stars: ✭ 472 (+9340%)
Mutual labels:  bootstrap, jquery
Tableexport
The simple, easy-to-implement library to export HTML tables to xlsx, xls, csv, and txt files.
Stars: ✭ 781 (+15520%)
Mutual labels:  bootstrap, jquery
Yan
使用Maven构建,整合Dubbo+Zookeeper+SpringMVC+Spring+MyBatis+Redis支持分布式的高效率便捷开发框架
Stars: ✭ 293 (+5760%)
Mutual labels:  bootstrap, jquery
Windows 95 Ui Kit
💾 Windows 95 UI Kit made with Bootstrap 4 components
Stars: ✭ 294 (+5780%)
Mutual labels:  bootstrap, jquery

raytable

I wanted a very simple to use jQuery data table that met 95% of the patterns I needed which included paging, sorting, adding a few button columns with custom handlers, and using icons and styles from Bootstrap to keep it simple.

I know ther are TONS of js gridtables in the world but the best ones cost and others take some time to figure out all the settings. I'm trying to keep this one as simple as possible.

raytools.js is the only required file with dependencies on Bootstrap 3 and jQuery 1.12. It has not been upgraded to Bootstrap 4. All icons come from the Bootstrap 3 Glyphicons.

Live Demo

Raytools data grid

See the index and data file to see how to configure.

jQuery(document).ready(function () {

	dataTable = jQuery("#dataTable").raytable({
		datasource: { data: [], keyfield: 'id' },
		columns: [
			{ title: "Info", icons: [{ glyph: "glyphicon-info-sign", handler: iconAction, data:"id" }], renderIf: isManager },
			{ field: "firstName", title: "First Name", sort:true },
			{ field: "lastName", title: "Last Name", sort: true },
			{ field: "title", title: "Title" },
			{ field: "grade", title: "Grade", sort: true },
			{ field: "ssn", title: "SSN"  },
			{ field: "birthDate", title: "DOB", sort: true, format: parseDate },
			{ title: "Delete", icons: [{ glyph: "glyphicon-trash", handler: iconAction, data: "id" }] }
		],
		pagesize: 13,
		maxPageButtons: 5,
		rowNumbers: true,
		rowClickHandler: rowAction
	});

Parameters & Options

  • datasource - The datasource property contains information about the data to render itself.
    • data - the actual data to render which can be initialized with an empty array or set to JSON list of data objects. After initial rendering of the table it can be set with the table function using myTable.data(myData,'id').
    • keyfield - keyfield is the object property to use to identify each unique row object - usually a string, GUID or Int unique identifier.
  • columns - Columns is the array of column objects to display which mainly need a title and field to map to in the data objects.
    • field - the actual object property field name.
    • title - the column header displayed
    • width - the width in pixels to hard code this column to.
    • icons - (optional) An arary of Glyph icons to display in the column so each column can have more than one icon.
      • glyph - the glyph's CSS class name from the Bootstrap 3 glyphicons.
      • handler - (optional) a callback to handle clicking on the icon. Column icon event handlers return a jQuery event in which event.data = {rowIdx:< 0 based row index >, id:< object key field >}. Icon clicks stop the bubbling of the event any further.
      • data - (optional) Additional data to set the ray-data attribute to.
    • sort - (optional, default is false) set to true to allowing sorting on this field.
    • renderIf - (optional) a callback function with the signature (item)->bool, where item is the object bound to that row, that returns whether to even render the contents of the cell at all. This can be use to skip cell icons based on some condition and simply a shortcut to using format that returns an empty string if the condition is true.
    • format - (optional) a callback function with the signature (item)->string, where item is the object bound to that row, that returns a format string to display in that cell, such as formatting dates.
  • pageSize - (optional, defaults to 25) Should be self-explanatory, the number of items to display per page.
  • rowNumbers - (optonal) default is false) If set to trye, the first column will display an incrementing row count.
  • maxPageButtons - (optional) the maximum number of pager buttons to display.
  • noDataLabel - (optional) the text to display where there is no data to display.
  • rowClickHandler - (optional) If the row is click and not an icon with a handler, then you can set a generic row click handler. This will set the table's currentSelection property to an object with the zero based row index as well as the keyfield ID of the object bound to that row. It will also send back a jQuery event in which event.data = {rowIdx:< 0 based row index >, id:< object key field >} to the handler.

Setting Data at Runtime

Use the 'data' method The first parameter is the JSON object array and the second is the object property to use as the unique identifier

dataTable.data(myData,'id');

Accessing Bound Data

for (var i; i < dataTable.datasource.data.length; ++i)
{
	var item = dataTable.datasource.data[i];
}

Handle an Icon Click Event

function iconAction(event)
{
	// event is jQuery event
	// cast it to a jQuery element and get the ray-data attribute which the field set in the definition
	var data = jQuery(event.target).data('ray-data');

	// or use event.data which is an object {id:objectKey, rowIdx:clickedRow}
	alert('You clicked the icon with data = ' + event.data.id + ' on row ' + event.data.rowIdx );
}

Handle a Row Click Event

function rowAction(event)
{
	// clicking a row outside of an icon is similar - just get the ray-key attribute
    var id = jQuery(event.target).data('ray-key');
    alert('You clicked row ' + event.data.rowIdx + ' with object ID ' + event.data.id );
}

Handle a Conditional Render

function isManager(item)
{
	return (item.grade > 4);
}

Handle Custom Formatting

function parseDate(item)
{
	// source is ISO 8601
    var d = new Date(item.birthDate);
    return d.toDateString();
}

Enjoy

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].