Comments (2)
Normally I use this with a separate event, whether it be an onclick of a "Filter" button or onblur of a textfield. Basically you would call out the datatable object that you want to update.
var dt = $("#link_table").data("datatable")
Once I have my element, I gather the filter data currently on the table
postdata = dt.options.filter
Then I update the properties on the filter that I want to update
postdata.search_mode = $('#search_mode').val();
Finally I call the render function to rerender the datatable without reloading the whole page.
dt.render();
On the server side, the post comes in as an associative array with filter as the main. So for PHP you would pull in the post data like so.
$filter_data = $_POST['filter'];
// $filter_data contains
array(
"search_mode" => foo
);
Hope this helps.
from bootstrap-data-table.
Sorry to bump an old question, but it is related to an issue that I'm facing.
The above "trick" will work only if I haven't modified the post data that i'm passing.
If I add any extra post data , like the csrf token, or an ID that I want to pass
, post: {_token: "<?php echo csrf_token();?>", category_id: <?php echo $category->category_id; ?>}
then after the
dt.render();
, i check in firebug and the extra "search_mode" filter does not get posted.
If i comment out the ,post: {......} and do the same, then search_mode is posted.
Any ideas about this?
from bootstrap-data-table.
Related Issues (20)
- About sorting HOT 1
- Question about rerender table in onClick event HOT 12
- Demo of data table? HOT 1
- Reload Data
- extending bootstrap-data-table. HOT 1
- Sort Option HOT 1
- Bootstrap 3 and pagination
- Filter input disappears HOT 1
- Seems can not reload/refresh table HOT 3
- Strange filter icon HOT 1
- Multi Row Select HOT 2
- Dynamically update the table HOT 5
- Bootstrap 3.1.1Patch
- min file out of sync
- allowExport HOT 3
- Can't get it to work HOT 5
- Clickable rows HOT 2
- Sorting bug, after desc there is null HOT 1
- Question about sortOrder HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-data-table.