问题
I ma writing custom editor for slickgrid.
slick.editors.js
/***
* Contains basic SlickGrid editors.
* @module Editors
* @namespace Slick
*/
(function ($) {
// register namespace
$.extend(true, window, {
"Slick": {
"Editors": {
"Text": TextEditor,
"Integer": IntegerEditor,
"Float": FloatEditor,
"Date": DateEditor,
"YesNoSelect": YesNoSelectEditor,
"Checkbox": CheckboxEditor,
"PercentComplete": PercentCompleteEditor,
"LongText": LongTextEditor
}
}
});
function TextEditor(args) {
var $input;
var defaultValue;
var scope = this;
.
.
.
})(jQuery);
The function can be called under namespace
import { Editors } from 'slickgrid-es6';
Editors.TextEditor()
Now I want to add here myTextEditor(args) function, but not altering slick.editors.js file.
in myText.js the function is written like this below
var myTextEditor = function MyTextEditor(args) {
var $input;
var defaultValue;
var scope = this;
then I want to add this under Slick namespace in Editors module.
so that I can call Editors.myTextEditor()
Is it possible??
来源:https://stackoverflow.com/questions/53293466/adding-function-to-namespace-module-from-another-file