Comments (13)
yea, infinite scroll would be cool :)
I tried implementing this a year or two ago, but it worked really crappy with an ajax data source. Maybe datatables.net js library has improved since then?
from effective_datatables.
just find the line it errors on, then binding.pry
figure out why it can't find it :)
It might be worth starting in /app/controllers/effective/datatables_controller.rb
from effective_datatables.
What date-range picker library would you want to implement? :)
Adding the input might not be too difficult...have you seen effective_form_inputs gem? that's what I'm using for all my "wrap javascript library in a rails form helper" stuff.
But actually working with a date range instead of a singular value might require some changes to the finder.
effective_datatables uses
https://github.com/code-and-effect/effective_datatables/blob/master/app/models/effective/datatable_value_tool.rb
the datables value tool to do all the ordering/searching of arrays.
And delegates any SQL/activerecord finder stuff to an Effective::Resource object, which is in another gem, effective_resources,
It ends up here:
and maybe here:
Accepting PRs! I'd love to see what ideas you have.
Cheers :)
from effective_datatables.
This is where all the search options are initialized:
And here is how they're rendered. Based on the search[:as]
value
from effective_datatables.
FYI,
In effective_form_inputs
https://github.com/code-and-effect/effective_form_inputs/blob/master/app/assets/javascripts/effective_date_picker/initialize.js.coffee
It's not a date range plugin...but it automatically supports linked date pickers, as per:
http://eonasdan.github.io/bootstrap-datetimepicker/Options/
So if you have two form inputs with names like "item[start_at]" and "item[end_at]", selecting a time on the start_at picker, will set the minDate of the end_at datepicker. Linking them, kinda...
from effective_datatables.
can we add lazy load in data tables and fixed header of tables?
i got error while apply sort datatable not found
from effective_datatables.
lazy load is a bad idea because you end up just making 2 requests instead of just 1.
Imho, you might as well prepopulate the table with the first page of records on the first GET request / initial render, instead of loading an empty datatable and then making an ajax request for the data. Especially if there's more than 1 datatable being displayed per page. T
hat's the approach I've always used! You're welcome to play with it tho, the javascript library does support it. Checkout the javascript init options at
as the datatables javascript library does support this approach.
As for the fixed headers, I I have tried implementing them before before, but wasn't able to get it working properly...
https://datatables.net/extensions/fixedheader/
You're welcome to give it a shot. Should just need to drop in the fixedheader specific javascript and css file to get it working in this gem. Cheers.
from effective_datatables.
by lazy load i mean infinite scroll instead of using pagination
from effective_datatables.
can you provide demo of that infinite scroll and i am facing issue while searching or sorting its shows me alert which contain text like
data table not found
from effective_datatables.
nah, sorry I don't have any code lying around for that...check out some of the other datatables.net javascript libraries that are included...follow that pattern..
from effective_datatables.
while searching or sorting its shows me alert which contain text like
data table not found
from effective_datatables.
is it possible to retrieve collection in controller and use it in datatable class?
from effective_datatables.
you could initialize the datatable in a controller
@DataTable = Klass.new(self)
then call @datatable.to_json or @datatable.collection on it.
Search for the hooks, check out def finalize
from effective_datatables.
Related Issues (20)
- buttons_export_columns not working in input_js HOT 2
- any plan on building effective datatables for tailwind? HOT 1
- modal in effective-datatables HOT 1
- searching on association table (not foreign key) causes crashes HOT 1
- config.save_state not working HOT 6
- Click on Select all HOT 5
- Stuck on first datatable some doubts. HOT 10
- Custom Inline Action Buttons from Array of Arrays HOT 3
- When joining multiple tables (with the Collection) the row count for paging becomes very slow HOT 4
- Set Width in column not working HOT 4
- uninitialized constant Ability HOT 2
- speeding up fuzzy searches HOT 2
- attributes not available in actions_col? HOT 1
- Auto-compute column labels using AR I18N HOT 2
- Rails 7 HOT 5
- download all option triggering network failure HOT 1
- weird UI on initial load; refresh fixes it HOT 4
- ActionView::Template::Error (undefined method `sql_operation' for #<Effective::Resource:0x00007f91316954a0> HOT 1
- Out of date jquery.dataTables.js HOT 3
- SQL queries loaded twice, serverside and ajax HOT 3
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 effective_datatables.