Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering broken when injecting columns from a parent node #90

Closed
Saulis opened this issue Jun 17, 2016 · 5 comments
Closed

Filtering broken when injecting columns from a parent node #90

Saulis opened this issue Jun 17, 2016 · 5 comments
Milestone

Comments

@Saulis
Copy link
Owner

Saulis commented Jun 17, 2016

<!doctype html>
<head>
<meta name="description" content="iron-data-table beta3">
  <meta charset="utf-8">
  <script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>
  <link href="../iron-data-table.html" rel="import">
  <link href="../default-styles.html" rel="import">
</head>
<body>
  <dom-module id="x-foo">
    <template>
      <iron-data-table items="[[items]]">
        <content select="data-table-column"></content>
      </iron-data-table>
    </template>
    <script>
      document.addEventListener('WebComponentsReady', function() {
        Polymer({
          is: 'x-foo',
          properties: {
            items: {
              value: function() {
                var items = [];

                for (var i=0; i < 100; i++) {
                  items.push({'value': 'foo'+i});
                }

                return items;
              }
            }
          }
        });
      });
    </script>
  <dom-module>

  <x-foo>
    <data-table-column name="Column 1" filter-by="value">
      <template>[[item.value]]</template>
    </data-table-column>
  </x-foo>
</body>
@Saulis
Copy link
Owner Author

Saulis commented Jun 17, 2016

Related with Polymer/polymer#3196

This was referenced Jun 17, 2016
@Saulis Saulis added this to the 1.0.0-beta4 milestone Jun 26, 2016
@tpluscode
Copy link

Hi. You mentioned Polymer/polymer#3196. Did you somehow overcome the problem in issue #93?

@Saulis
Copy link
Owner Author

Saulis commented Aug 4, 2016

@tpluscode IIRC the problem was running templatize() with two different templates on the same Templatizer object. Some variables inside it don't get reset after templatizing again and then template instances are expected to have some instance properties that the previous template was having.

Worked around the issue by making sure there is always a single template used per Templatizer.

@tpluscode
Copy link

Sadly, I don't think that's my problem. Even with one template I can't get it to work.

And by the way, what do you mean single template per templatizer? It's a behavior so I guess one template per element instance?

@Saulis
Copy link
Owner Author

Saulis commented Aug 4, 2016

Yeah exactly, per element instance.

I have a faint recollection that I might've done also a monkey patch somewhere... Let's see.

Update: found it https://github.com/Saulis/iron-data-table/blob/master/data-table-templatizer-behavior.html#L90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants