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

data-height and data-filter-control not working together #5013

Closed
yogendramaarisetty opened this issue May 1, 2020 · 8 comments
Closed

data-height and data-filter-control not working together #5013

yogendramaarisetty opened this issue May 1, 2020 · 8 comments
Labels
confirmed Issues that have been confirmed with a reduced test case and identify a bug. duplicate Issues that are duplicated with other issues. filter-control Issues for the filter-control extension.

Comments

@yogendramaarisetty
Copy link

<table
  id="table"
  data-filter-control="true"
  data-show-search-clear-button="false"
  data-search="true"
  data-height="460"
  data-toolbar="#toolbar"
  >
  <thead>
    <tr>
    <th data-field="state" data-checkbox="false"></th>
     <th scope="col">Sno.</th>
      <th data-filter-control="input"  id="th1" data-field="id"  scope="col">Employee ID</th>
      <th data-filter-control="input"  data-field="first_name"  scope="col">First Name</th>
      <th data-filter-control="input"  data-field="last_name" scope="col">Last Name</th>
      <th data-filter-control="input"  data-field="DOB" scope="col">Date of birth</th>
      <th data-filter-control="input"  data-field="joining_date" scope="col">Joining date</th>
      <th data-filter-control="input"  data-field="experience" scope="col">Experience</th>
    </tr>
  </thead>
</table>

The generated table does not show filter input boxes when we add data-height attribute
filters are working fine without data height

@vossivossi
Copy link

vossivossi commented May 14, 2020

I have exactly the same problem, the issue is reproducable.
Here an example with data-height where the filter is not shown:
https://live.bootstrap-table.com/code/vossivossi/2888

If you just remove the statement ' data-height="625" ' in line 1 the filter-control works, here the same example without data-height and working filter-control:
https://live.bootstrap-table.com/code/vossivossi/2889

@wenzhixin wenzhixin added filter-control Issues for the filter-control extension. confirmed Issues that have been confirmed with a reduced test case and identify a bug. labels May 16, 2020
@3cdota
Copy link

3cdota commented May 18, 2020

我也遇到了相同的问题

@yogendramaarisetty
Copy link
Author

But that is not the solution I was expecting.
I wanted both filter-control and height together

@UtechtDustin
Copy link
Collaborator

@yogendramaarisetty we are working on that issue.
@wenzhixin @djhvscf currently i cant figure out that issue...
But i found out that the createControls function (

) will be executed to late (so no controls can be created).
After that the header will be copied (https://github.com/wenzhixin/bootstrap-table/blob/develop/src/bootstrap-table.js#L1814).
Im not sure what happens there ;o

@vossivossi
Copy link

One more comment (I don't know if it helps): The problem exists only since version 1.16.0 , there is no problem with 1.15.5

@Crowesesse
Copy link

Issue appears to be here

key: "initHeader",
value: function initHeader() {
_get(_getPrototypeOf(_class.prototype), "initHeader", this).call(this);
if (!this.options.filterControl) {
return;
}
UtilsFilterControl.createControls(this, UtilsFilterControl.getControlContainer());
}

UtilsFilterControl.getControlContainer() always returns the $tableHeader when the height is set rather then the $header which is needed here. Working for me once I changed that back to UtilsFilterControl.createControls(this, this.$header);

@djhvscf
Copy link
Collaborator

djhvscf commented Jun 13, 2020

I reviewed this. It looks like the order in which the table is rendered. I think we need to listen to new events (in filter-control) or use a trick like setTimeOut

@wenzhixin
Copy link
Owner

Duplicate of #4869

@wenzhixin wenzhixin marked this as a duplicate of #4869 Jun 13, 2020
@djhvscf djhvscf added the duplicate Issues that are duplicated with other issues. label Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Issues that have been confirmed with a reduced test case and identify a bug. duplicate Issues that are duplicated with other issues. filter-control Issues for the filter-control extension.
Projects
None yet
Development

No branches or pull requests

7 participants