1

I tried to do a whole row to be referenced to another page, but it doesn't work when my table is defined as a bootstraptable in the javascript. If it is a simple table, it works correctly. Maybe the BootstrapTable extension doesn't support it?

I used this question for the implementation

This part from the javascript:

$.ajax({
  url: "/virtual_zeros/filterProntos",
  type: 'post',
  data: {
    'id': id
  },
  success: function(data) {
    $('#contentDiv').html(data);
    $('#vzTable').bootstrapTable();
  },
  error: function(jqXHR, textStatus, errorThrown) {
    alert(textStatus);
    alert(errorThrown);
  }
});

This is the relevant part of the .volt file:

<tbody>
  {% if data['someKindOf'] == null %} {% else %} {% for tableData in data['someKindOf'] %}
  <tr class="clickable-row" data-url='https://foo.bar.com/foo_contorller/somefunction/id={{tableData['id']}}'>
    {% for headerData in data['someKindOf2'] %}
    <td>{{tableData[headerData]}}</td>
    {% endfor %}
  </tr>
  {% endfor %} {% endif %}
</tbody>
Community
  • 1
  • 1
Renato88
  • 57
  • 6
  • 1
    Where and when are you attaching the event handler? – Rob M. May 15 '15 at 16:00
  • 1
    Well formatted question for your first post, just watch the tags (bootstrap != twitter-bootstrap) and if your code-snippets have no functionality, you don't need to include them. (Code block yes, code snippet no) – Tim Lewis May 15 '15 at 16:01
  • I tried to attach the event handler in two places. My first idea was to attach it in the javascript, after the definition, because there is another event handler too, and works correctly. – Renato88 May 15 '15 at 22:43
  • So after it, I put it into the view file. When I defined the vzTable as table, it works, and can redirect me to the link, but when I define it as a bootstrap table, it doesn't do anything. Can't imagine why... – Renato88 May 15 '15 at 22:46
  • Tim Lewis, thanks for advice. As you can see, it was my first question, and I tried to format it correctly. In code snippet I found the tidy, and it does all my work with the text formatting. But next time i will ignore it, and use the simple code block. – Renato88 May 15 '15 at 22:49

0 Answers0