Comments (16)
Hey again @GaneshMaduranathan
I have your fix here! Upgrade to effective_datatables 2.4.5
Then use
table_column :is_global, filter: { include_blank: false, collection: [['All', 'Global'], ['Yes', 'Yes'], ['No', 'No']] }
from effective_datatables.
Hello,
I need one more quick help on showing the select options in table header in case of boolean fields.
Say, the column name in the table is "required" with true/false values. The way the column getting rendered in the table is with options "Required,Yes,No", How can I change that to "All,Yes,No" in setting up the datatable properties in the path "app/models/effective/datatables/file_name.rb"
Thanks Again !!!
from effective_datatables.
In this case, there will be four options in the select box. "IsArchived","Yes","No","All".
I don't want "IsArchived" instead I need it to be "All".
that means only three options in the select box. "All","Yes","No".
Ex: I have a boolean column named :is_global.
When Showing in select box, now it is,
- IsGlobal
- Yes
- No
But I need like,
- All
- Yes
- No
Overriding search functionality is not a problem !!!
from effective_datatables.
` Global All Yes No `
I don't want the first option - <option value="">Global</option>
.
I need like below:
` All Yes No `
from effective_datatables.
I added the include_blank
and placeholder
support, so you can pass both values straight into simple_form
from effective_datatables.
Glad you're getting use out of the gem! :)
I agree that the CSS you posted would definitely hide the checkboxes. That CSS doesn't come from this gem tho!
Good luck!! hehe
from effective_datatables.
My bad.
Is there anyway I can do INLINE edit on each row and save?
Thanks!
from effective_datatables.
Hey again,
Nope, this effective_datatables gem doesn't have any kind of inline edit support.
The underlying javascript library does have this feature as a paid option:
https://editor.datatables.net/
Or you could write your own javascript to pop up a modal dialog, edit a row, then update the row and/or call refresh on the underlying datatable.
could be a good place to start
from effective_datatables.
Try
table_column :is_archived, filter: { values: ['Yes', 'No, 'All'] }
and then you might need to override the search function as per
https://github.com/code-and-effect/effective_datatables#customize-filter-behaviour
from effective_datatables.
Hello,
Is there any update you have me on this?
from effective_datatables.
Are you just trying to change the filter bar collection?
table_column :is_global, filter: { collection: ['All', 'Yes', 'No'] }
Then you could do something like
def search_column(collection, table_column, search_term, sql_column)
if table_column[:name] == 'is_global'
collection.where('is_global ILIKE ?', "%#{search_term}%")
else
super
end
end
from effective_datatables.
Actual:
filter: { collection: ['All', 'Yes', 'No'] } will give me something like this:
What I need:
Please check the screenshots I have attached. I need that "All" label to behave like "Global". The first option in the select box always has the "table column's name" (here the column label is "global"). Instead I want that to be "All".
from effective_datatables.
This is just calling the simple_form f.input :global, as: :select
in the background. So any collection you would pass to simple_form will work here. Maybe what you want is:
table_column :is_global, filter: { collection: [['Global', 'All'], ['Yes', 'Yes'], ['No', 'No']] }
from effective_datatables.
table_column :is_global, filter: { collection: [['All', 'Global'], ['Yes', 'Yes'], ['No', 'No']] }
from effective_datatables.
Thanks @matt-riemer!
from effective_datatables.
There you are !!!!! Simply Awesome !!!!
Thanks a ton @matt-riemer :)
from effective_datatables.
Related Issues (20)
- Filter does not search when pasting a text using just mouse HOT 1
- 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
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.