Skip to content

Instantly share code, notes, and snippets.

(function ($) {
/** Define editors first */
function TextEditor() {}
/** Create the Slick.Editors object if it does not exist */
if (!window.Slick.Editors)
window.Slick.Editors = {};
/** Extend the Slick.Editors with ones you have defined */
$.extend(true, window.Slick.Editors, {
/***
* Base editor - From which all of our slickgrid editors are derived
* @module Editors
* @namespace Slick
*/
(function ($) {
function BaseEditor() {}
/** Create the Slick.Editors object if it does not exist */
/***
* Base editor - From which all of our slickgrid editors are derived
* @module Editors
* @namespace Slick
*/
(function ($) {
function BaseEditor() {}
BaseEditor.prototype.init = function ()
/***
* Text editor - Simple text editor for metadata
* @module Editors
* @namespace Slick
*/
(function ($) {
function TextEditor (args) {
this.args = args;
this.init();
BaseEditor.prototype.init = function () {
if (this.args) {
this.container = this.args.container;
this.column = this.args.column;
this.item = this.args.item;
this.grid = this.args.grid;
}
this.$input = $('<input type="text" />')
.on('keydown', this.handleKeyDown.bind(this));
/***
* DatePicker - A cell editor with bootstrap datepicker driven calendar
* @module Editors
* @namespace Slick
*/
(function ($) {
function DatePicker (args) {
var scope = this;
this.args = args;
{
id : "1",
field : "SortCode",
name : "Bank Sort Code *",
validator : "^[0-9]{6}$"
editable : true,
editor : SlickGrid.Editors.DatePicker,
formatter : SlickGrid.Formatters.TextFormatter
}
/***
* Base editor - From which all of our slickgrid editors are derived
* @module Editors
* @namespace Slick
*/
(function ($) {
function BaseEditor() {}
/**
@lgoldstien
lgoldstien / js_text_methods_capitaliseFirst.js
Created June 25, 2014 08:26
Javascript Text Methods: capitaliseFirst
/**
* capitaliseFirst
*
* Makes the first letter of a string a capital
* @param {string}
* @return {string}
*/
capitaliseFirst = function (text) {
return text.substring(0, 1).toUpperCase() + text.substring(1);
};
@lgoldstien
lgoldstien / js_text_methods_trimToWord.js
Last active August 29, 2015 14:03
Javascript Text Methods: trimToWord
/**
* trimToWord
*
* Trim a string to one word less than @length characters
* @param {string} - The string to be trimmed
* @param {int} - The maximum length of the returned string
* @return {string}
*/
trimToWord = function (string, len) {
if (string.length >= len) {