This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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, { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* 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 */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* Base editor - From which all of our slickgrid editors are derived | |
* @module Editors | |
* @namespace Slick | |
*/ | |
(function ($) { | |
function BaseEditor() {} | |
BaseEditor.prototype.init = function () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* Text editor - Simple text editor for metadata | |
* @module Editors | |
* @namespace Slick | |
*/ | |
(function ($) { | |
function TextEditor (args) { | |
this.args = args; | |
this.init(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* DatePicker - A cell editor with bootstrap datepicker driven calendar | |
* @module Editors | |
* @namespace Slick | |
*/ | |
(function ($) { | |
function DatePicker (args) { | |
var scope = this; | |
this.args = args; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
id : "1", | |
field : "SortCode", | |
name : "Bank Sort Code *", | |
validator : "^[0-9]{6}$" | |
editable : true, | |
editor : SlickGrid.Editors.DatePicker, | |
formatter : SlickGrid.Formatters.TextFormatter | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* Base editor - From which all of our slickgrid editors are derived | |
* @module Editors | |
* @namespace Slick | |
*/ | |
(function ($) { | |
function BaseEditor() {} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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) { |