npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kendo-grid-editors

v1.1.2

Published

Additional grid editors for kendo-ui library.

Downloads

9

Readme

kendo-grid-editors

Additional grid editors for kendo-ui library.

Demo

A demo is available on the Github Pages webpage for kendo-grid-editors here.

Basic Usage

// create grid
var grid = $grid.kendoGrid({
            dataSource: dataSource,
            columns: [{               //column settings
                field: "type",
                title: "Type",
                editor: function(container, options) {      // create custom editors
                    // setup required options
                    options.text = 'text';
                    options.value = 'value';
                    //  some data
                    var list = [{
                        value: 0,
                        text: "Jarry"
                    }, {
                        value: 1,
                        text: "Mike"
                    }, {
                        value: 2,
                        text: "Jane"
                    }];
                    KendoGridEditors.dropDownEditor(container, options, list);   // use specific editor
                },
                template: function(dataItem) {    // how to dispay in grid cell
                  options = {};
                  options.field = field;
                  return KendoGridEditors.dropdownTemplate(dataItem, options); // use specific value template
                },
                width: 90
            },
            ... // setup other columns

Editors

stringEditor

template is not required

columns:[{
...
 editor: KendoGridEditors.stringEditor
...
}]

numericEditor

template is not required

columns:[{
...
 editor: function(container, options) {
                options.format = "n";
                options.decimals = 20;
                KendoGridEditors.numericEditor(container, options);
            }
...
}]

dateEditor

columns:[{
...
  template: function(dataItem, field) {
                options = {};
                options.field = field;
                options.format = "dd.MM.yyyy";
                return KendoGridEditors.dateTemplate(dataItem, options);
            },
  editor: function(container, options) {
                options.format = "dd.MM.yyyy";
                KendoGridEditors.dateEditor(container, options);
            }
...
}]

timeEditor

columns:[{
...
 template: function(dataItem, field) {
                options = {};
                options.field = field;
                options.format = "HH:mm";
                return KendoGridEditors.timeTemplate(dataItem, options);
            },
  editor: function(container, options) {
                options.format = "{0:HH:mm}";
                KendoGridEditors.timeEditor(container, options);
            }
...
}]

memoEditor

template is not required

columns:[{
...
  editor: function(container, options) {
                KendoGridEditors.textAreaEditor(container, options);
            }
...
}]

boolEditor

columns:[{
...
  template: function(dataItem, field) {
                options = {};
                options.field = field;
                return KendoGridEditors.boolTemplate(dataItem, options);
            },
  editor: function(container, options) {
                KendoGridEditors.boolEditor(container, options);
            }
...
}]

colorEditor

columns:[{
...
  template: function(dataItem, field) {
                options = {};
                options.field = field;
                return KendoGridEditors.colorTemplate(dataItem, options);
            },
  editor: function(container, options) {
                KendoGridEditors.colorEditor(container, options, 'basic', 7);
            }
...
}]

dropdownEditor

columns:[{
...
  template: function(dataItem, field) {
                options = {};
                options.field = field;
                return KendoGridEditors.dropdownTemplate(dataItem, options);
            },
  editor: function(container, options) {
                options.text = 'text';
                options.value = 'value';
                var list = ... //some dataSource
                KendoGridEditors.dropDownEditor(container, options, list);
...
}]

dropDownImageEditor

columns:[{
...
  template: function(dataItem, field) {
                var options = {};
                options.field = field;
                options.value = 'value';
                options.image = 'image';
                options.text = 'text';
                return KendoGridEditors.dropdownImageTemplate(dataItem, options);
            },
  editor: function(container, options) {
                options.text = 'text';
                options.value = 'value';
                options.image = 'image';
                var list = ... //some images dataSource
                KendoGridEditors.dropDownImageEditor(container, options, list);
            }
...
}]

multiSelectEditor

columns:[{
...
  template: function(dataItem, field) {
                options = {};
                options.field = field;
                options.text = 'text';
                return KendoGridEditors.multiSelectTemplate(dataItem, options);
            },
  editor: function(container, options) {
                options.text = 'text';
                options.value = 'value';
                var list = ...// some dataSource
                KendoGridEditors.multiSelectEditor(container, options, list);

            }
...
}]

License

This code is provided under the MIT license.