Comments (16)
Same problem for me, for the same goal. Having the id in the table but not visible.
option array('visible' => false) does not work
👍
from datatablesbundle.
I can not find any issue. Is this a problem with CSS?
from datatablesbundle.
I just don't know...
My scenario :
- I add this on a datatable :
->add('id', 'column', array('visible' => false))
- I refresh my web page
- I can see this new column
- In the page source, I can see this generated js code, that's seems right :
var columns = {
"columns": [
{
"searchable": true,
"orderable": true,
"visible": false,
"title": "",
"className": "",
"defaultContent": "",
"width": "",
"contentPadding": "",
"name": "",
"data": "id",
},
Then, I don't know how datatable.js should hide this column... probably with CSS. Anyway, in the element inspector, I can't see any specific CSS class on this column and its cells so that they are hidden :-(
from datatablesbundle.
please try only:
'%kernel.root_dir%/../vendor/datatables/datatables/media/css/jquery.dataTables.css'
from datatablesbundle.
Does not work...
I removed my assets installed with bower, I install the recommended bundle with composer "datatables/datatables": "1.10.4"
, and finally put the new css and js in my base template :
{% stylesheets '%kernel.root_dir%/../vendor/datatables/datatables/media/css/jquery.dataTables.css' output="css/jquery.dataTables.css" %}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
../..
{% javascripts '%kernel.root_dir%/../vendor/datatables/datatables/media/js/jquery.dataTables.js' output="js/jquery.dataTables.js" %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
Then, when I add this on my datatable, the new column still appears :
->add('id', 'column', array('visible' => false))
from datatablesbundle.
cache cleared?
Am 10.01.2015 14:31 schrieb "Herve MILLET" [email protected]:
Does not work...
I removed my assets installed with bower, I install the recommended bundle
with composer "datatables/datatables": "1.10.4", and finally put the new
css and js in my base template :{% stylesheets '%kernel.root_dir%/../vendor/datatables/datatables/media/css/jquery.dataTables.css' output="css/jquery.dataTables.css" %} <link rel="stylesheet" href="{{ asset_url }}" /> {% endstylesheets %}
../..
{% javascripts '%kernel.root_dir%/../vendor/datatables/datatables/media/js/jquery.dataTables.js' output="js/jquery.dataTables.js" %} <script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}Then, when I add this on my datatable, the new column still appears :
->add('id', 'column', array('visible' => false))
—
Reply to this email directly or view it on GitHub
#57 (comment)
.
from datatablesbundle.
Yes sir !
Can you explain me how datatable should hide a column with visible: false ?
It puts a css class on column or somewhere ? or it does just create the dom for this column ?
from datatablesbundle.
see the answer: https://datatables.net/forums/discussion/25416/how-datatable-should-hide-a-column-with-visible-false
The one common 'gotcha' is using Responsive with column visibility, since Responsive controls the column visibility. You can add the class never to a column if you never want it to be visible.
from datatablesbundle.
It works after a change of "visible" everything properly. You still have to delete the browser's cache.
from datatablesbundle.
Thanks a lot Steffen.
But I can't understand what means "a change of "visible" everything properly"
from datatablesbundle.
I change from "visible=>false" to "visible=>true".....or "visible=>true" to "visible=>false".
This works for me only if I delete the cache of the browser.
from datatablesbundle.
Ok, I will try this tomorrow and tell you.
from datatablesbundle.
Thanks @stwe, looks like the gotcha mentioned by allan with Responsive datatables extension is the reason for my case, as I'm using it.
The Responsive documentation for the class never
is here:
https://datatables.net/extensions/responsive/classes#Special-classes
@hmillet are you using this extension too?
from datatablesbundle.
@fdelapena , i can add:
{% if column.visible %}
"visible": true,
"className": "{{ column.className }}",
{% else %}
"visible": false,
"className": "never {{ column.className }}",
{% endif %}
from datatablesbundle.
Thanks, looks good to me to have it in, as the Responsive extension looks popular and doesn't bloat much the code result when unused.
from datatablesbundle.
@stwe : Now that I understand that "cache cleared" means "browser cache", that's work fine for me, sorry for this misunderstanding...
@fdelapena : Hi ! I don't use the Responsive datatables extension, but... it seems great, I probably do it soon ;-)
from datatablesbundle.
Related Issues (20)
- Basic sample configuration in Symfony5. Someone? HOT 3
- Custom DateTimePicker HOT 1
- Disable translation of selectFilter entries
- Showing all entries does not work HOT 2
- Edit inline selected value missing HOT 1
- Notice: Array to string conversion in search VirtualColumn HOT 4
- Calling setHint() on the Query
- Support for the v1.x HOT 4
- parent recursive
- SetMaxResult HOT 1
- Individual Filtering error HOT 1
- Array to string conversion in search VirtualColumn HOT 1
- Problem with dql, filter and global search
- Undefined constant Doctrine\DBAL\Types\Type::DATETIME HOT 4
- Bug on function getName() HOT 3
- Hidden DateTimeColumn is all empty when switched to visible until reload HOT 1
- Symfony 6.0 support HOT 3
- Search in translate value of VirtualColumn HOT 1
- Does MultiselectColumn require or use the Select extension? HOT 2
- Invalidate Result cache? 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 datatablesbundle.