How to use cheetah-grid - 5 common examples

To help you get started, we’ve selected a few cheetah-grid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github future-architect / cheetah-grid / packages / demo / src / main.js View on Github external
import cheetahGrid from 'cheetah-grid'
import Vue from 'vue'
import VueRouter from 'vue-router'
import router from './router'
import CGrid from 'vue-cheetah-grid'
import App from './App.vue'

Vue.use(VueRouter)
Vue.use(CGrid)

Vue.filter('numberDelimiter', (value) => value.toLocaleString())

// todo use fmt
Vue.filter('dateFormat', (d, fmt) => d ? `${d.getFullYear()}/${d.getMonth() + 1}/${d.getDate()}` : '')

cheetahGrid.themes.default = cheetahGrid.themes.default.extends({
  // font: '16px Roboto, sans-serif'
})
// router hook
router.beforeEach((to, from, next) => {
  document.title = `${to.meta.title} | Cheetah Grid Demo`
  next()
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: ''
})
github future-architect / cheetah-grid / packages / demo / src / vue / WelcomePage.vue View on Github external
function createGrid (el, v) {
  const personsDataSource = generatePersonsDataSource(1000000)

  const startTime = new Date()

  const grid = new cheetahGrid.ListGrid({
    parentElement: el,
    header: [
      { field: 'check', caption: '', width: 50, columnType: 'check', action: 'check' },
      { field: 'personid', caption: 'ID', width: 85 },
      {
        field: 'stars',
        caption: 'Class',
        width: 150,
        columnType: new cheetahGrid.columns.type.IconColumn({
          name: 'star'
        }),
        style: {
          color: 'gold'
        },
        action: new cheetahGrid.columns.action.InlineMenuEditor({
          options: [
            { value: 1, classList: 'stars', html: '<i class="material-icons">star</i>' },
            { value: 2, classList: 'stars', html: '<i class="material-icons">star</i>'.repeat(2) },
            { value: 3, classList: 'stars', html: '<i class="material-icons">star</i>'.repeat(3) },
            { value: 4, classList: 'stars', html: '<i class="material-icons">star</i>'.repeat(4) },
            { value: 5, classList: 'stars', html: '<i class="material-icons">star</i>'.repeat(5) }
          ]
        })
      },
      {
github future-architect / cheetah-grid / packages / demo / src / vue / WelcomePage.vue View on Github external
action: new cheetahGrid.columns.action.SmallDialogInputEditor({
              classList: 'helper-text--right-justified',
              helperText (value) {
                return `${value.length}/20`
              },
              inputValidator (value) {
                return value.length > 20 ? `over the max length. ${value.length}` : null
              }
            })
          },
          {
            field: 'lname',
            caption: 'Last Name',
            width: '20%',
            minWidth: 150,
            action: new cheetahGrid.columns.action.SmallDialogInputEditor({
              classList: 'helper-text--right-justified',
              helperText (value) {
                return `${value.length}/20`
              },
              inputValidator (value) {
                return value.length > 20 ? `over the max length. ${value.length}` : null
              }
            })

          }
        ]
      },
      {
        field: 'progress',
        caption: 'Progress',
        width: '10%',
github future-architect / cheetah-grid / packages / vue-cheetah-grid / lib / c-grid / utils.js View on Github external
export function normalizeAction (action) {
  if (action && typeof action !== 'string') {
    if (typeof action === 'function') {
      action = new cheetahGrid.columns.action.Action({
        action
      })
    } else if (typeof action.actionName === 'string') {
      action = new cheetahGrid.columns.action[action.actionName](action.option)
    }
  }
  return action
}
github future-architect / cheetah-grid / packages / demo / src / vue / WelcomePage.vue View on Github external
function createGrid (el, v) {
  const personsDataSource = generatePersonsDataSource(1000000)

  const startTime = new Date()

  const grid = new cheetahGrid.ListGrid({
    parentElement: el,
    header: [
      { field: 'check', caption: '', width: 50, columnType: 'check', action: 'check' },
      { field: 'personid', caption: 'ID', width: 85 },
      {
        field: 'stars',
        caption: 'Class',
        width: 150,
        columnType: new cheetahGrid.columns.type.IconColumn({
          name: 'star'
        }),
        style: {
          color: 'gold'
        },
        action: new cheetahGrid.columns.action.InlineMenuEditor({
          options: [

cheetah-grid

Cheetah Grid is a high performance grid engine that works on canvas

MIT
Latest version published 29 days ago

Package Health Score

76 / 100
Full package analysis