Saulis / iron-data-table

iron-data-table is a Web Component for displaying data as a table or grid. Built on top of iron-list using Polymer.
Apache License 2.0
147 stars 66 forks source link

Q : data Source don't work with my code, but I don't know why #166

Closed chmuche closed 7 years ago

chmuche commented 7 years ago

Hello, I try too use the property dataSource but I have always the same error : Uncaught TypeError: dataSource is not a function(…)

my code :

<iron-data-table selection-enabled multi-selection id="mainDataTable" page-size="20" data-source="={{dataSource}}">
     <content></content>
</iron-data-table>

properties: {
dataSource: {
    notify: true,
    value: function() {
        return this._dataSource.bind(this);
    }
}
}

_dataSource: function (opts, success, err) {
    console.log("_dataSource");
},

but I have the error on the part of code in iron-data-table : line 849

dataSource({
    page: page,
    pageSize: this.pageSize,
    filter: this.filter,
    sortOrder: this.sortOrder
}, success, err);

or when I insert a little console.log(dataSource); above of your code I see my function

I tried other things like

properties: {
dataSource: {
    notify: true,
    value: function() {
        return this._dataSource;
    }
}
}

Thanks for your help, BTW I'm not a Js master only 2 months of painful :smile:

chmuche commented 7 years ago

My mad data-source="={{dataSource}}" is wrong :-1: