当前位置: 首页 > 软件库 > 程序开发 > >

ember-yeti-table

Yeti Table
授权协议 MIT License
开发语言 JavaScript
所属分类 程序开发
软件类型 开源软件
地区 不详
投 递 者 葛修永
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Yeti Table

Yeti Table provides a new expressive way to build tables in Ember with flexibility in mind.

Installation

ember install ember-yeti-table

Why Yeti Table?

Perhaps the biggest difference compared to other table solution is that Yeti Table uses templates to define your columns.In many other table solutions you need to define columns in javascript.Yeti Table was born from an experimentation of trying to define columns in templates.

In practice, this empowers customization and feels more in line with writing regular HTML tables.This fact has many implications on the whole API of Yeti Table.

Yeti table currently weights around 6.17kb (minified and gzipped).

Features

Yeti Table was built with the needs of a real production app in mind. Out of the box, it supports:

  • Client side row sorting - On a single column or on multiple columns.
  • Client side row filtering - You can apply a global filter to the table or just to specific columns.
  • Client side pagination - Provides pagination controls, but encourages you to build your own as well.
  • Server side data - Allows your server to drive the table pagination, filtering and sorting if you choose to. Useful when the dataset is too large to fetch.
  • Customization - Does not provide any styles. You can customize pretty much everything about how the tables are rendered on your templates. This includes custom css classes, click handlers and custom filtering and sorting logic.

Usage

Your starting point for Yeti Table will be the @data argument. It accepts an array of objectsor a promise that resolves to such an array.

Then you must define your table columns inside the header component, each of them with a @prop argument that corresponds to theproperty key of each object that you want to display for that column. Yeti Table will update itself based onthese property names, e.g if a firstName property of an object changes, Yeti Table might need to re-sortor re-filter the rows.

Afterwards, we just need to define our table body. If you use <table.body/> in the blockless form,Yeti Table "unrolls" all the rows for you. This is useful for simple tables. Here is such an example:

<YetiTable @data={{this.data}} as |table|>

  <table.header as |header|>
    <header.column @prop="firstName">
      First name
    </header.column>
    <header.column @prop="lastName">
      Last name
    </header.column>
    <header.column @prop="points">
      Points
    </header.column>
  </table.header>

  <table.body/>

</YetiTable>

You will probably need to make more customizations, and to do so you will need to use <table.header>and/or <table.body> in the block form. This form allows you to:

  • Use any component or markup as a cell's content
  • Use the row data across multiple cells of the same row
  • Attach click listeners to the row or cell
  • Use row data to conditionally add classes

Each <body.row> component accepts an optional @onClick action that will be called if the row is clicked.

Additionally, you might need to toggle the visibility of each row, and for that we can use the @visible argumenton the <header.column> component. It defaults to true. Setting it to false will hide all the cells for that columnaccross all rows.

The <header.column> component also accepts a @columnClass argument. Yeti Table will apply this class all the cellsfor that column accross all rows.

Check out more advanced features on the Yeti Table documentation site.

Compatibility

  • Ember.js v3.20 or above
  • Ember CLI v3.20 or above

Editor integration

You can get autocomplete and additional information inside Visual Studio Code by installing els-addon-docs addon for Unstable Ember Language Server.

Credits

Credits to the amazing Ember Table addon.

Yeti Table was also inpired by DataTables in a lot of its features.

Contributing

Installation

  • git clone <repository-url>
  • cd ember-yeti-table
  • npm install

Linting

  • npm run lint:hbs
  • npm run lint:js
  • npm run lint:js -- --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

For more information on using ember-cli, visit https://ember-cli.com/.

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

 相关资料
  • Yeti 是一个浏览器上的 JavaScript 测试运行器,基于 Node.js。你可以使用 Yeti 来测试 YUI 每个部件。 特性 与用户已经使用的框架一起使用。 无需任何其他软件即可自动执行测试。不需要 Selenium! Istanbul提供的内置代码覆盖范围。 适用于IE 6 +,Android 4 +,Firefox,Safari,Chrome,iOS 4+。 使用echoecho

  • Ember检查器是一个浏览器插件,用于调试Ember应用程序。 灰烬检查员包括以下主题 - S.No. 灰烬检查员方式和描述 1 安装Inspector 您可以安装Ember检查器来调试您的应用程序。 2 Object Inspector Ember检查器允许与Ember对象进行交互。 3 The View Tree 视图树提供应用程序的当前状态。 4 检查路由,数据选项卡和库信息 您可以看到检查

  • 英文原文: http://emberjs.com/guides/getting-ember/index/ Ember构建 Ember的发布管理团队针对Ember和Ember Data维护了不同的发布方法。 频道 最新的Ember和Ember Data的 Release,Beta 和 Canary 构建可以在这里找到。每一个频道都提供了一个开发版、最小化版和生产版。更多关于不同频道的信息可以查看博客

  • ember-emojione ember-emojione is your emoji solution for Ember, based on the EmojiOne project. EmojiOne version 2 is used, which is free to use for everyone (CC BY-SA 4.0), you're only required to giv

  • Ember 3D Ember 3D is an Ember addon for using Three.js - an easy to use, lightweight, javascript 3D library. It is designed to: Prescribe a solid file structure to Three.js code using ES6 modules. Ena

  • Ember Table An addon to support large data set and a number of features around table. Ember Table canhandle over 100,000 rows without any rendering or performance issues. Ember Table 3.x supports: Emb