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

Source binding for table elements doesn't support tbody templates #777

Open
akorchev opened this issue May 5, 2015 · 1 comment
Open

Comments

@akorchev
Copy link
Contributor

akorchev commented May 5, 2015

Reproduction:

<script type="text/template" id="template">
  <tbody>
      <tr><td>a</td></tr>
      <tr><td>b</td></tr>
  </tbody>
  </script>
  <table data-bind="source: data" data-template="template"></table>
<script>
  var vm = kendo.observable({
    data: [1, 2, 3]
  })
  kendo.bind(document.body, vm);
</script>
@washamdev
Copy link

washamdev commented Mar 8, 2018

We spent hours trying all kinds of things to get this to work, only to find out it's a bug in Kendo template binding. Any chance this can be escalated?

The bug in question here comes from this code:

https://github.com/telerik/kendo-ui-core/blob/master/src/kendo.binder.js#L515-L526

Here is the specific code causing the bug:

if (element.nodeName.toLowerCase() == "table") {
    if (!element.tBodies[0]) {
        element.appendChild(document.createElement("tbody"));
    }
    element = element.tBodies[0];
}

Basically, it needs to account for the fact that the template may include <tbody> tags itself, so the above code shouldn't insert its own <tbody> tag as well.

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

No branches or pull requests

6 participants