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

angular-ui-datatables

v0.1.4

Published

```html <ng-datatables option="option" data="data" onChange="dataChanged(data)"></ng-datatables> ```

Downloads

7

Readme

ngDataTables使用说明

快速入门

<ng-datatables option="option" data="data" onChange="dataChanged(data)"></ng-datatables>
$scope.option={
    columns:[{
      data:'string',
      title:'string',
      filters:[{
        name:'string',
        params:['string','string']
      }],
      template:'string',
      style:{width:'50px'}
    }],
    methods:{},
    serverSide:true,
    ajax: 'url',
    data:[],
    paging: true,
    version: 1
  }

配置项说明

  • option.version:[number] 表格的版本,默认为0,为0时不显示表格,当我们队表格属性做出修改之后,应该主动刷新版本号,表格数据会自动更新。
  • option.serverSide:[boolean] 是否启用服务器数据,为true时启动服务器分页。
  • option.ajax:[string/object] ajax请求的路径或者Angular.ajax对象。
  • option.paging:[boolean] 是否启用分页
  • option.columns:[Array] 表格列配置
    • option.columns[i].data:[string] 该列要显示的数据的(key)
    • option.columns[i].title:[string] 列标题
    • option.columns[i].style:[object] 列标题样式,这个样式会通过ng-style绑定到表格的标头上。
    • option.columns[i].filters:[Array/string] 数据的过滤器。支持对象和字符串模式。如果是一个数组,将对数据依次应用所有过滤器, 支持 'filter1:params1|filter2:params2|filter3:params3'的级联字符串模式。 注意:字符串的参数是按':'分隔的,如果你的参数中包含':',请不要使用字符串模式
      • option.columns[i].filters[i].name:[string] 使用的过滤器名称
      • option.columns[i].filters[i].params:[Array:string] 过滤器的参数。
      • option.columns[i].filters[i].template:[string] 这一列使用的动态模板
  • option.data:[Array[object]] 数据数组。当serverSide===false时该配置生效
  • option.methods:[object] 一个对象,当我们使用template/titleTemplate属性时,我们可以在template中使用在这里定义的方法和对象。

静态数据使用示例

html

<ng-datatables option="option" data="data" onChange="dataChanged(data)"></ng-datatables>
$scope.option={
  columns:[],
  serverSide:false, //重要,启用静态数据时,必须将serverSide设置为false,默认为false
  paging:true
}

服务器端数据使用示例

服务器通信

事件回调

  • onChange(data) 当前页显示数据改变时:触发该事件,data改变后的数据内容

使用列模板