-
Notifications
You must be signed in to change notification settings - Fork 39
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
Does this work? #2
Comments
hi @danielmwilliams , can you see any errors in console? There is a plunker example that works for me, see http://plnkr.co/edit/CSwl1u |
I fiddled it out:
So you end up with: <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="/css/bootstrap-theme.min.css" />
<link rel="stylesheet" type="text/css" href="/css/bootstrap-table.min.css" />
<link rel="stylesheet" type="text/css" href="/css/bootstrap-table-filter.css" />
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/bootstrap-table/bootstrap-table.min.js"></script>
<script type="text/javascript" src="/js/bootstrap-table/extensions/bootstrap-table-filter.min.js"></script>
<script type="text/javascript" src="/js/bootstrap-table-filter/bootstrap-table-filter.js"></script>
<script type="text/javascript" src="/js/bootstrap-table-filter/bs-table.js"></script> The table will be displayed with: <div id="filter-bar"> </div>
<table id="tbl"
data-toggle="table"
data-url="/data1.json"
data-toolbar="#filter-bar"
data-show-toggle="true"
data-show-filter="true"
data-search="true"
data-pagination="true"
>
<thead>
<tr>
<th data-field="id" data-align="right" data-sortable="true">Item ID</th>
<th data-field="name" data-align="center" data-sortable="true">Item Name</th>
<th data-field="price" data-align="" data-sortable="true">Item Price</th>
</tr>
</thead>
</table> Make sure to place the data1.json in your webroot for testing OR add a HTH Alex |
I followed AlexWerz answer and got the following error: Uncaught TypeError: Cannot read property 'defaults' of undefined bootstrap-table-filter.min.js:8 I really like the extentsion and tried a lot, but nothing works for me. |
You could check the versions of the libraries you have installed. If that
|
I use the latest version of bootstrap-table and bootstrap-table-filter and bootstrap 3.2. I see no problem with the versions My Code:
I also tried to set the filter by adding
With this I can select filters but they don't work |
Are you able to show data without the extension? If not then your problem is with bootstrap-tables. Other than that I am of no help :-( |
@lukaskral Your plnkr example does not currently work. I cannot get this to work at all. I can get the widget to show up but it doesn't do anything. |
@lukaskral I also noticed that with your 3 .js files included this breaks:
What I mean by 'breaks' is that when this code is triggered the table is not filtered and there are no errors, but the data in the table gets messed up and I cannot access row data in the bootstrapTable I hope this helps! I have removed your scripts from my project and implemented my own filtering. |
Looks like your plugin doesn't work. I spent a lot of time trying to integrate your plugin to my project but every time I saw just filter button with one option 'Reset all filters'. |
Someone managed? |
I don't know if anyone solved this on other topics but I will show how to make it work to have the answer here as well. Put the following js files wherever you want and link them in your HTML file (yes, there are 2 different bootstrap-table-filter.js files): Then put the table code and update data-url path for your data:
That's it. |
@sozerberk Yes. This is the documented method, but as we have been saying this is not currently working. Even the plnkr example (http://plnkr.co/edit/CSwl1u) is broken. Could you post a plnkr or jsFiddle to show us how it is done? I believe you will find that it does not currently work. If you can prove that it does, then the documentation and example will need to be updated to the current correct method. |
Hi @ethompsy, you can find a working version in this Plunker example. |
@sozerberk Thank you so much for the working example! I may need to use this soon. I would like to point out one thing: You used the scripts from @wenzhixin repository and not the scripts from this repository. Here is an example of what happens using the scripts from this repo: I think this is the confusion. Perhaps some people (myself included) did not realize that we should not use these files. They used to be linked to from the bootstrap-table extensions page. |
May this example http://issues.wenzhixin.net.cn/bootstrap-table/#561.html help? |
@ethompsy You're welcome. Yes, the scripts are different. Also, I should warn you search doesn't work with filter extension. I think the problem is at the else at the end of the bs-table.js. If @lukaskral can fix this, it would be really nice. |
@wenzhixin Yes, it works there as well but search doesn't work again. Any idea how to fix it? |
@sozerberk , thank you so much for your working example! =D |
You're welcome @murilodbva , I'm glad it works for you :) |
@danielmwilliams , there is how to mark this issue like resolved? |
@sozerberk Your plunker demo stops working as soon as I try to run the file locally or on localhost. Tried CDNs as well as locally saved scripts and css. Neither is it picking up the json data to display in table. :/ |
@Ruvy , here worked very well. |
@murilodbva No one is to blame but me. Was using old bootstrap-table script. All fine now :) Thanks @sozerberk for the working demo. |
Hi, |
I think it stop working again... your Plunker example @sozerberk stop working again... in the available filters it show you an "undefined" column... |
@sozerberk I was able to track down this issue with the Search not working with Filtering. You can see my answer here: http://stackoverflow.com/a/32151137/5253968 |
Hello. This is my set up. //Table data I did notice that if I add $('#filter-bar').bootstrapTableFilter(); it does not work at all (unless I rmove the bs-table.js file). So how do I get the bs-table.js file to see my data ? |
here is my Solution to use the dinamyc filters in bootstrap-table and place it in the ajax submit to the server. Note that the "data" is place in just one field. Here is the Link |
using creative-tim, data-control-filter is not working in bootstrap table, can you please help on this issue. Thank you in advance. |
I cannot get this to work? Documentation examples vary greatly. Repo does locally and on jsfiddle without luck. Can you help me out here?
The text was updated successfully, but these errors were encountered: