Git Product home page Git Product logo

paper-datatable's Issues

How to set length of dataSource after ajax request

Hi,

I can't find out how to set the length of a dataSource after I made an ajax request. Could you give me a hint or is this not implemented yet?

I tried

length: function () {
    return new Promise( function ( resolve, reject ) {
        resolve(500);
    } );
}

self.dataSource.length = 500;
self.dataSource.set( 'length', 500 );
self.dataSource.set( 'numberOfItems', 500 );
self.$.datatable._setNumberOfItems( 500 );

Thanks for your help

Greetings Kersten

Debounce `set` calls

Set calls can happen at a crazy rate if used in combination with for example a <google-map>

Add filtering capability to paper-datatable

It would be great to add a filtering option to the component ร  la datatables.net. It would probably be an implementation of the native filter(), but it would be nice if paper-datatable-column had a filterable attribute that indicated if you wanted to filter on thiat column or not.

Show `<paper-datatable-column>` inside or on top of `th`

This is a lot harder than it sounds, as

  1. The columns need to register (attach) before table generation can start
  2. But <th> are located inside the generated table

so you get a bit of a paradox, which could be solved by just showing them on top of the th's.

How to pass format-value a function inside a customer Polymer element?

example:

<paper-datatable-column ... format-value="[[formatValue]]" ...> </paper-datatable-column>
Polymer({
    is: "xyz",
    ...
    formatValue: function(value){
      return (this._isNumeric(value) ? Number(value).toLocaleString("en-US") : value );
    }
});

It won't overwrite the default implementation for formatValue in paper-datatable-column.html.

Data changes do not get properly notified upwards

Not sure what's happening, but since the update to Polymer 1.2 data changes on arrays do not get properly notified upwards as can be seen in the demo/datatable.html demo at the bottom of the page.

Firebase intagration

If you use Firebase, then when editing rows in the table after the first editing, breaks "focus" or "binding"
Imgur

Single selection not working

.splices doesn't get 'initialized' thus _isRowSelected doesn't trigger in

_isRowSelected(item, multiSelection, selectedItem, selectedItems.splices)

causing single selection to not work

Overflow question

Migrated from #39 @NamTThai

I recently found your project and it looks amazing. Just a question. I have a couple of use case when table overflow data quite easily. So how do you handle overflow in these 2 cases:

  • Overflowing vertically: Do you have a feature for freezing table header and only scrolling table body? I know that you have a feature to only display 10/20 rows but sometimes it would be great to show all the rows.
  • Overflowing horizontally: Adding too many columns and it no longer fits on viewport. How do you deal with this? Is there a bottom scrollbar for example?

Thanks for the amazing work!

Show sort indicator on hover

It's a bit hidden in the material design spec, but on :hover an indicator should be shown that a column is sortable.

Doesn't work in Edge

Edge debugger is super crappy, so not sure what's happening, but:

Unable to get property 'title' of undefined or null reference

Somewhere in paper-datatable.html.js

Add deselection GUI in card

Cancelling selection requires finding the selected rows now, which sucks in <paper-datatable-card>'s that support multi page selection.

Creating columns for arrays?

David - thanks so much for building and sharing this element. I've found it extremely helpful in my project.

I'm struggling with implementing one of my usecases... Was hoping you could point me in the right direction.

I have a datatable mapped to an Object "results" which contains an array called "legs". Is there an idiomatic way to create a column for each item in the legs array? My first thought was to do a <dom-repeat> of <paper-datatable-columns> with custom <template>s. However, I haven't figured out how to access the each of the items within the <template>.

Is there a simple solution that I haven't found? I appreciate the guidance!

`selectAll` only selects items on current page

Per title, problem is that selecting all items would require a new function on the data-source that requests all ids~ Relatively easy to do when using the ids->getByIds approach, harder with just the get approach.

TypeError when underlying property for paper-datatable-column is undefined.

<paper-datatable-column header="My Header" property="myproperty"></paper-datatable-column>

If myproperty is undefined in any row, following TypeError causes all the subsequent rows to be left unrendered.

TypeError: Cannot read property 'toString' of undefined
    at paper-datatable-column.Polymer._cast (paper-datatable-column.html:331)
    at paper-datatable-column.Polymer._formatValue (paper-datatable-column.html:289)
    at paper-datatable.<anonymous> (paper-datatable.html:595)
    at Object.Debouncer.complete (polymer.html:1227)
    at Object.Polymer.Async._atEndOfMicrotask (polymer.html:1184)
    at MutationObserver.window.MutationObserver.observe.characterData (polymer.html:1199)

I believe following code in paper-data-column._formatValue should be moved up before call to _cast.

if(typeof data == 'undefined'){
    return '';
}

Array-index property or sub-property

Do you support data binding with array index or sub-property? Say I have this data object:

[
  {
    "id": 1,
    "infoArray": [a, b, c],
    "infoObject": {
      "prop1": "var1"
    }
  }
]

and I want to build a table like this:

<paper-datatable data="{{data}}">
  <paper-datatable-column header="Info Array" property="infoArray.0"></paper-datatable-column>
  <paper-datatable-column header="Info Object" property="infoObject.prop1"></paper-datatable-column>
  <paper-datatable-column header="Info Array2" property="infoArray[0]"></paper-datatable-column>
</paper-datatable>

Whilst data is loading

Things to do whilst data is loading in <paper-datatable-card>:

  1. Show a progressbar
  2. Fixate header width.

Implement weakCache.js again

Would be neat to cache items whilst browsing in <paper-datatable-card>. Sad part is that a real weak cache isn't possible yet in modern browsers, but it looks like this will be coming at some point in the future, so implementing weakCache.js would create a nice basis to have strong caching for now and an easy layer to set up weak caching later.

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.