Giter Club home page Giter Club logo

Comments (20)

miyconst avatar miyconst commented on August 28, 2024

@tomalec could you please take a look?

from juicy-table-repeat.

tomalec avatar tomalec commented on August 28, 2024

Shorted test case:

  1. Click on "Update first row"
  2. Click on "Remove first row"
  3. Click on "Update first row"

from juicy-table-repeat.

tomalec avatar tomalec commented on August 28, 2024

It is index .0 vs key #0 mismatch, probably due to the fact that we are re-stamping all the rows at https://github.com/Juicy/juicy-table-repeat/blob/gh-pages/juicy-table-repeat.html#L77 in case of remove/insert of just one.

from juicy-table-repeat.

tomalec avatar tomalec commented on August 28, 2024

It seems we are facing all the problems that are solved by Polymer's dom-repeat so we would probably need to move most of its logic to here.

@warpech, @miyconst WDYT about forking (and making a PR of) dom-repeat and implementing what was proposed at Polymer/polymer#3448?

[edit: I have removed my proposition as it was simply wrong]

For me injecting one more template to the dom-repeat seems easier that replicating its behavior. Also to replicate dom-repeat logic, we would need to go through and understand entire code anyway.

from juicy-table-repeat.

tomalec avatar tomalec commented on August 28, 2024

Or maybe we should just ask people to fallback to:

<juicy-table>
<template is="dom-repeat">
</template>
</juicy-table>

na make juicy-element do nothing more than just extending HTMLTableElement ?

from juicy-table-repeat.

warpech avatar warpech commented on August 28, 2024
<juicy-table>
<template is="dom-repeat">
</template>
</juicy-table>

If it works, I'd love it!

from juicy-table-repeat.

miyconst avatar miyconst commented on August 28, 2024

@tomalec am I right that you want to stamp <tr>s with native Polymer's dom-repeat and them move them into <table>?

Well, if that would work, I am all for it.

P.S. Any solution which works in IE to generate table rows is good for me, even if it requires a bit more code or another <template>.

from juicy-table-repeat.

warpech avatar warpech commented on August 28, 2024

I wonder if you can get this to work:

<juicy-table class="table"><!-- "table" is a Bootstrap class -->
  <thead>
    <tr>
      <template is="dom-repeat" items="{{Headers}}"><!-- my column headers -->
        <th>{{item.Label}}</th>
      </template>
    </tr>
  </thead>
  <tbody>
    <template is="dom-repeat" items="{{People}}"><!-- my rows -->
      <tr><td>{{item.FirstName}}</td><td>{{item.LastName}}</td></tr>
    </template>
  </tbody>
</juicy-table>

See source of Bootstrap .table

from juicy-table-repeat.

tomalec avatar tomalec commented on August 28, 2024

@warpech

If it works, I'd love it!

It works but you loose user agent styles

See https://jsbin.com/coxere/edit?html,output


@miyconst

am I right that you want to stamp s with native Polymer's dom-repeat and them move them into

?
Not really. Anyway I need to review my proposition in Polymer's issue as it seems not to solve the problem.

from juicy-table-repeat.

miyconst avatar miyconst commented on August 28, 2024

@warpech as far as I remember it won't work. IE removes every node from <tbody> and <table> which is not <tr> and puts it after the element.

So, it will be equal to:

<juicy-table class="table"><!-- "table" is a Bootstrap class -->
  <thead>
    <tr>
    </tr>
  </thead>
  <template is="dom-repeat" items="{{Headers}}"><!-- my column headers -->
    <th>{{item.Label}}</th>
  </template>
  <tbody>
  </tbody>
  <template is="dom-repeat" items="{{People}}"><!-- my rows -->
    <tr><td>{{item.FirstName}}</td><td>{{item.LastName}}</td></tr>
  </template>
</juicy-table>

Does not seem to work even in Chrome - https://jsfiddle.net/qc5qv5e5/.

from juicy-table-repeat.

tomalec avatar tomalec commented on August 28, 2024

For that we will need juicy-tr, juicy-thead,...

from juicy-table-repeat.

miyconst avatar miyconst commented on August 28, 2024

@tomalec your solution does not seem to work in IE:

image

from juicy-table-repeat.

tomalec avatar tomalec commented on August 28, 2024

My bad.
You'r right, I was checking in Edge :(

So we need to either

  1. fix this bug. I'm afraid that this and bugs that are to come, will require us to do more or less this: https://github.com/Polymer/polymer/blob/master/src/lib/template/dom-repeat.html, so in long term it should be easier to..
  2. Implement (few weeks) / wait for Polymer to implement (∞ ?) Polymer/polymer#3448 (comment)

from juicy-table-repeat.

tomalec avatar tomalec commented on August 28, 2024

@warpech how urgently do we need a fix, and how crucial it is?

from juicy-table-repeat.

miyconst avatar miyconst commented on August 28, 2024

@warpech, @tomalec what if we go the "smart" way and just drop the IE support?

from juicy-table-repeat.

tomalec avatar tomalec commented on August 28, 2024

what if we go the "smart" way and just drop the IE support?

I'd love to 😎 Especially, that it seems that event Microsoft is pushing Edge forward and do not bother much about IE11 support.

The question is: what about our customers, and demos that are supposed to look clean and work cross platform?

from juicy-table-repeat.

warpech avatar warpech commented on August 28, 2024

from juicy-table-repeat.

miyconst avatar miyconst commented on August 28, 2024

Let's not drop IE11support before Polymer.

Polymer only partially supports it.

from juicy-table-repeat.

warpech avatar warpech commented on August 28, 2024

Let's wait until Polymer 2.0, which may fix this

from juicy-table-repeat.

tomalec avatar tomalec commented on August 28, 2024

https://github.com/Starcounter/CompanyTrack/issues/233

from juicy-table-repeat.

Related Issues (9)

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.