Giter Club home page Giter Club logo

aurelia-bs-grid's People

Contributors

charleh avatar charlespockert avatar jmjf avatar wichert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aurelia-bs-grid's Issues

Support table-less grid

Grid should support a table less output where elements of user specification will be used in place.

This will allow a simple repeatable control with column support

Paging

Hi Charles,
Things are looking better very time I get a chance to checkout the latest. It seems that your demo emulates server side paging. As a veteran of angular girds (ng-grid, ng-table, angular-grid and kendo-ui) all supporting client side paging, I'd like to know if this is something in the works.
TIA
John

Support update/delete in server mode

Could make updates deletes hit a set of callbacks which pass the data/splices which you then pass on to your back end returning a promise if you want the grid to auto refresh?

Look at what feels comfortable

Updates to support the Aurelia Framework v0.15.0

Per today's framework updates, there are changes to how plugins are handled.

Unhandled promise rejection TypeError: aurelia.globalizeResources is not a function
    at a.configure (http://localhost:9010/jspm_packages/github/charlespockert/[email protected]/index.js:7:13)
    at http://localhost:9010/jspm_packages/github/aurelia/[email protected]/aurelia-framework.js:34:34

aurelia.globalizeResources is now aurelia.use.globalResources

http://aurelia.io/docs.html#the-aurelia-object

There may be additional changes necessary that could be tacked onto this issue.

In row editing

Allow in-row editing where any changes are made directly to the bound data source.

Pager issue on first load

From User @liuyuanhuo on gitter:

I use CharlesPockert/aurelia-grid's pager custom element, use pager.ref="pager" to reference pager.
when call 'this.pager.update' in attached method, got error: Uncaught TypeError: Cannot read property 'update' of undefined, and pager not work right on first load.
after page loaded, It works right, no error.
in UserList.cshtml

<pager num-to-show.bind="10" pager.ref="pager" on-page-changed.call="setPage($event)"></pager>

in ListViewModel.js

export class ListViewModel {
  router;
  route;
  service;
  entities = [];
  isLoading = false;

  pageParams = {
      pageSizeList :app.consts.grid.defaultPageSizes,
      pageSize : app.consts.grid.defaultPageSize,

      pageIndex : 1,
      totalRecordCount:0,

      sorting: null,
      filterText: null
  };

  constructor(route, router, service) {
    this.route = route;
    this.router = router;
    this.service = service;
  }

  updatePager() {
      this.pager.update(Number(this.pageParams.pageIndex), Number(this.pageParams.pageSize), Number(this.pageParams.totalRecordCount));
  }

  load() {
      this.isLoading = true;
      var that = this;
      this.service.getPage(
          that.pageParams,
          function(result) {
              that.entities = result.entities;
              that.pageParams.totalRecordCount = result.totalRecordCount;
              that.isLoading = false;

              // Update the pager - maybe the grid options should contain an update callback instead of reffing the
              // pager into the current VM?
              that.updatePager();
          },
          function() {
              that.isLoading = false;
          }
      );
  }

  loadFirstPage() {
      this.pageParams.pageIndex =1;
      this.load();
  }

  setPage(index) {
        this.pageParams.pageIndex = index;
        this.load();
  }

  open(id) {
    this.router.navigate(this.route + '/' + id);
  }


  activate() {
      this.loadFirstPage();
  }
}

@charlespockert , is this a problem ?

Headings are only supported as string (no expressions)

if you use an expression like

${ 'table.column.condition'|t}

for heading in a element it will display that as a literal and not the bound/compiled expression. Makes it difficult for supporting i18n labels/headers.

sorting in the demo

Hi,

Sorting is not working in demo
when you sort first on id and then on name for example

Greetings

Pager path broken

e.g. Not Found: http://localhost:9000/dist/pager/pager.js when trying to use the grid

Win8 demo install issues

Hi,

  1. Just tried to install demo on win8 /node 0.12.6/ npm 3.1.0
  2. Initially the following npm repos missing
    Error: Cannot find module 'filesize'
    Error: Cannot find module 'gzip-size'
  3. After installing repos I get following on gulp watch
    Error in plugin 'gulp-changed'
    Message:
    EPERM, stat 'c:\Aurelia\aurelia-bs-grid-demo\dist\animation-main.js'
    Details:
    errno: -4048
    code: EPERM
    path: c:\Aurelia\aurelia-bs-grid-demo\dist\animation-main.js
    fileName: c:\Aurelia\aurelia-bs-grid-demo\src\animation-main.js
    [07:41:25] Plumber found unhandled error:
    SyntaxError in plugin 'gulp-babel'
    Message:
    c:/Aurelia/aurelia-bs-grid-demo/src/animation-main.js: Unexpected token (6:4)

events.js:85
throw er; // Unhandled 'error' event
^
Error: EPERM, stat 'c:\Aurelia\aurelia-bs-grid-demo\dist\app.html'
at Error (native)

c:\Aurelia\aurelia-bs-grid-demo>
4) I have your plugin working within the forked skeleton annimation and with the exception of a different build process don't see what issue might be,
Thanks,
John

using materializecss with bootstrap?

i'm using dogfalo/materialize but had problems before utilizing the 2 frameworks.
problably css classes that have the same names.

question would be:
can i inject the materlialize css classes in your source code without changing your code in some way..

materlialize uses:

<div class="row" >
      <div class="col m6 s12 ">

Consider ways to make a scroll area in the middle of the grid

The grid doesn't have a scroll area. Kendo grid for example won't fill a screen (it requires a height specifying)

This should also fix the "Loader" overlay. This overlays the entire grid so that if the grid is huge the loader may appear off page (you still get the overlay you just can't see the loading bar).

The grid should specify server/client mode

It should be more explicit - at the moment you can sort of mix server and client paging/sorting etc

If it was more explicit it would be easier to understand what you as the consumer needed to provide (it's also confusing me!!)

Enhanced pager

The pager should allow you to jump in bunches, allow you to jump to the start/end of the table etc.

Virtual rows

Virtualized grid scroll area, Aurelia team are working on a feature that should make this work out the box

Total rows

Something like:

<grid show-totals="true"...

Users provide an expression on how to aggregate maybe?

demo

Hi Charles,
I'm trying to use bs-grid but not quite sure how to implement the plugin into my skeleton-nav project. I've successfully incorporated https://github.com/PWKad/aurelia-bs-modal as a plugin and looking for similar guidelines.
Thanks,
John

materialize

Hi,
I know you plan to remove dependency on bs but I'm pretty close to having the grid work with materialize (except for paging)

<grid grid-height.bind="640" read.call="getComments($event)" grid.ref="grid" server-paging.bind="false" server-sorting.bind="false"
      selectable.bind="true" page-size="10" no-rows-message="Nothing to see here!" show-jump-buttons.bind="false"
      show-first-last-buttons.bind="false"
      show-column-filters.bind="true">

        <grid-row>
          <grid-col heading="BCSNumber" field="BCSNumber" class="col m 1">${ $item.BCSNumber }</grid-col>
          <grid-col heading="Address" field="Address" class="col m 2">${ $item.Address }</grid-col>

          <grid-col heading="City" field="City" class="col m 8">${ $item.City }</grid-col>
        </grid-row>
      </grid>

having a problem with changing the paging control

  <div class="container">
    <div class="row">
      <div class="input-field col s12 m6">
        <select value.bind="page" materialize="select">
          <option value.bind="10">Items per page</option>
                <!-- <option repeat.for="page of pages" value.bind="grid.page-size">${page}</option> -->
                <option repeat.for="page of pages" value.bind="grid.pageSize">${page}</option>
        </select>
        <label for="Page">Page Count</label>
      </div>
   </div>

Allow user to customise the filter row

User should be able to specify a filter row template which allows a user to provide a different control for filtering (dropdown etc)

This should somehow call back to the grid to let it know the filter has changed (maybe just bind to the filterValue field on the column which can be tracked for changes by the grid)

Allow static grid rows in the template

Could cater for headers/footers, total rows (though I will try to support this anyway), custom filter rows etc

Something like:

<grid>
    <grid-static-row>... some html markup ...</grid-static-row>
    <grid-row>
        ... columns ....
    </grid-row>
    <grid-static-row>... some html markup ...</grid-static-row>
</grid>

Add filter columns to grid

This would be passed to the read method as part of the options:

e.g. the options object would look like

{
  filter: [{ col: "column1", filter: "filter value" }, ...]
  paging: { ... },
  sorting: { ... }
}

Setting page size on initialization does not work

If you set page-size="20000" it will still use 10. Unless you debounce a call to a bound variable in your view-model on attached(). example

export class MyTableVM {
         pageSize = 50;

         attached( ) {
              _.debounce(function(self) {
                 self.pageSize = self.pageSize * 1000;
              })(this);
          }
}

The subsequent html looks like

<grid page-size.bind="pageSize">
...
</grid>

in grid.js the page size is being read as 10 and only changes if your change that value after the fact (so your demos work but it not configurable in template)

Can not turn off paging

Paging appears to be set even when using pageable="false" on the element. However this is a string yet the code in grid.js assumes a Boolean. Such that

if (this.pageable && !this.serverPaging) tempData = this.applyPage(tempData);

will evalulate to true along with the if.bind statement if you specify the pageable parameter. You need to either convert the pageable to be string based or use a different parameter for input vs. bind - see my image below of my app (I am using my own paging toolbar to control content which is why I want it off)

image

With pageable="false" in the HTML with your grid (this is a different mode where I was hoping to show the grid)

image

Support grouping

User should be able to drag a column into a header area similar to other grid implementations which will group the data by the chosen column

Consumer can also programmatically group or apply via configuration

Add support for gird-header

hi, CharlesPockert
Could you add support for the table's header th template?may be grid-header, like grid-row,grid-col,

Consider moving the pager element into it's own repo

Not sure how useful this would be but the pager needs work anyway.

aurelia-bs-grid would probably need to be dependent on it (or at least some sort of pager control). Could pull all of the update stuff into an interface mechanism and allow a pager to plug-in using .call syntax

Allow grid to generate columns from an HTML table

Something like

<table grid>
    <tr>
        <th>Hello</th>
        <th>World</th>
    </tr>
    <tr>
        <td>123</td>
        <td>456</td>
    </tr>
</table>

Could even pass the setup to the grid and allow it to work with remote data etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.