0

I am using following example to do resizable columns:

https://live.bootstrap-table.com/example/extensions/resizable.html

If I did as the link example, set columns in thead:

<table id="table"

  data-url="json/data1.json"
  data-resizable="true">
  <thead>
    <tr>
      <th data-field="id" data-width="18">ID</th>
      <th data-field="name" data-width="20">Item Name</th>
      <th data-field="price" data-width="25">Item Price</th>
    </tr>
  </thead>
</table>

<script>
  $(function() {
    $('#table').bootstrapTable()
  })

then I can resize the columns.

However if I set columns in js like :

<table id="table"

  data-url="json/data1.json"
  data-resizable="true">

</table>

<script>
  var defaultColumns = [        
        {title: 'Id', field: 'id', width: 180},
        {title: 'Name', field: 'name', width: 100},
        {title: 'Price', field: 'price', width: 180}            
        ];

  $(document).ready(function() {

    $( '#table' ).bootstrapTable(

        {columns: defaultColumns}
    );
  });

Then I cannot resize the columns.

How can I resize the columns if I set the columns in js?

1 Answer 1

1

This is fixed in this pull request

Sign up to request clarification or add additional context in comments.

2 Comments

Got it, thank you very much! By the way, this fix will be in which version?
The version 1.16.0 is just released

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.