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 🙏

© 2026 – Pkg Stats / Ryan Hefner

v-datatable-ext

v1.0.3

Published

An Extension of Vuetify DataTable

Downloads

2

Readme

v-datatable-ext (with a widget of date time picker)

An Extension for Vuetify DataTable Preview This component make v-data-table more flexible, such as

  • Remote request for records
  • Customized buttons in table header and the last column (as action column)
  • Customized filtrations in table header
  • Colorized a text of a record even by a condition
  • Tell component which column is for avatar/tick
  • Show row number or not
  • Easy to define rows-per-page-items

Prop

setting

# php
// Directly use
<DataTableExt :setting="{{ json_encode($settings) }}"/>
// Import as a component. See below
<v-datatable-ext :setting="{{ json_encode($settings) }}"/>
<v-datetime-picker :label="{{ $label }}" />

Import as a component

import DataTableExt from 'v-datatable-ext';
Vue.use(DataTableExt);
const app = new Vue({
    el: '#app',
    vuetify: new Vuetify({}),
    components: { DataTableExt }
});

Explain the use of 'setting' prop

/* Example for setting prop */
let settings = {
  // 'headers' defines the table columns
  // 'text' is column head name
  // 'value' is the key of json object returned from backend. See 'debug.data' below
  // 'format' indicates the column style:
  //    'color': a more color property is needed. Its value should be the hex color string or an object in which 'prop' defined the key of json object returned from backend and the other key => value pairs indicate the record[key] => color
  //    'avatar': the value is a url to an image
  //    'tick': if the value is 0 then a tick will be shown, otherwise a cross mark will be shown
  headers: [
    { text: 'ID',         value: 'id', },
    { text: 'Name',       value: 'name',       format: 'color',  color: { prop: 'type', '2': '#FF0000'} },
    { text: 'Icon',       value: 'icon',       format: 'avatar', sortable: false },
    { text: 'Quaulified', value: 'quaulified', format: 'tick' },
  ],
  // 'showRow': Whether a row number column should be shown
  showRow: true,
  // 'selectable': Whether a checkbox column should be shown
  selectable: true,
  // 'selectEvents': Defines your custom buttons in table header
  //    'delete'(true|string): a red button with the given text in it. By clicking it, a post request to 'urlToDelete' with the id collection of selected items
  //    'actions'(array): Custom buttons.
  //      'always'(boolean): TRUE - Always be pressable; FALSE - Pressable only when any item is selected
  //      'text'(string): the button text
  //      'color'(string): the button color
  //      'event'(string): the event string emitted once pressed. You need to listen to this event by yourself.
  selectEvents: {
    delete: 'Delete some',
    actions: [
      { always:true, text:'Export', color:'light-green lighten-1', event:'evtExport' }
    ]
  },
  //  'pagination'(object): The built-in prop of v-data-table. If 'rowsPerPage' is not one of 'rowsPerPageItems', it will be ignored.
  pagination: { page:1, rowsPerPage:10, totalItems:0 },
  //  'rowsPerPageItems'(array): The enum numbers indicate kinds of rows-per-page-items
  rowsPerPageItems: [25, 50, 100],
  //  'filterList'(array): Put some dropdown lists in table header
  //    'hint'(string): the list text
  //    'items'(array): id-name pairs. If any item is selected, the id will be sent to backend.
  //    'type'(string): show a date time picker if its value is 'datetime' (the only value)
  filterList: [
    { hint: 'Gender', items: [{ id:0, name:'Female' }, { id:1, name:'Male' }, { id:2, name:'Need backend to filter' }] },
    { hint: 'Level',  type: 'datetime' },
  ],
  //  'buttons'(object): The buttons in the last column (except 'new' due to historic reason)
  //    'new': A button in table header for creating a new item. The only diff from 'selectEvents' is that it can be shown on the left of 'selectEvents.delete' button.
  //     'edit': A pencil-icon button to trigger event. It is supposed to handle item edit.
  //      'delete'(boolean): A trash-icon button to send request to 'urlToDelete' with item id
  //      'actions'(array):
  //        'text' - button text. Use ?: operator to show different texts by an item key;
  //        'icon' - button icon having higher priority to 'text'. Use ?: operator to show different icons by an item key
  //        'event' - the event string to send
  //        'lazyLoad' - fetch from 'url' before triggering the event with the returned json object[retKey]
  buttons: {
    new:  { text:'New Member', event: 'evtNewMember' },
    edit: { text:'Change', event: 'evtChange' },
    delete: true,
    actions: [
      { text:'deleted?Restore:Delete', icon:'deleted?fa-redo:fa-times', event:'evtSwitch' },
      { text:'Do It', icon:'fa-user', event:'openDetail', lazyLoad: { url:'/member/detail', retKey:'member' } }
    ]
  },
  //      'url'(string): The url to perform GET request for the items with following params appended.
  //         page: the current page number
  //         row: the row number per page
  //         query: the search string
  //         filter[0...n]: the values of filter lists
  //         sortBy: by which column need to sort
  //         direction: sort direction
  //       The returned json object:
  //         'data'(array): the new list of items
  //         'total'(int): the total number of items
  //         'setting'(object): Optional. You can reset the data table with a new setting
  url: '/list',
  //     'urlToDelete': the url send PUT request to. It is supposed to delete item(s)
  urlToDelete: '/delete',
}

License

MIT

Free Software, Hell Yeah!