question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Altering and hiding fields without updating the complete fields configuration

See original GitHub issue

I am transitioning from Datatables (http://datatables.net) to js-grid because Datatables is bloated and dusty and js-grid made a very good first impression on me.

However, I am missing convenient ways of altering or hiding fields that I temporarily don’t want to show. Updating the complete ‘fields’ option via $('#my_grid').jsGrid('option', 'fields', []); seems too cumbersome, because in addition to the changed field, I also always need to include the static fields that I never intend to change in the configuration array.

A utility method like jsGrid.alterField(column_name, new_settings) or jsGrid.alterField(column_name, key, value) would be really helpful for reducing overhead.

Hiding a column via CSS is not ideal either, because that messes up the widths of the other columns that have been calculated by js-grid. Datatables has a “visible” property for each field. This way, you can preconfigure all columns, even the ones that you don’t want to show immediately. When the time has come, you can simply change the “visible” property to true and the preconfigured column will show up. In combination with the abovementioned alterField() method you could easily show and hide columns with the benefit of js-grid recalculating the widths of the other columns, so that everything looks nice all the time.

A call to $('#my_grid').jsGrid('alterField', 'my_hidden_column', 'visible', true); would make my hidden column show up and re-render the table, so that all widths are recalculated nicely.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
SkyStalkercommented, Jul 31, 2016

So, in fact this feature is doesn’t work. We were unable to use it. It actually not hide, but destroy element from DOM. If we use it, we can’t get access to data of hidden field.

0reactions
jaslam94commented, Dec 11, 2020

@tabalinas the field value should be hidden but preserved and be able to be sent over to the server using insertItem function.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specifying field behavior | Administering Jira applications ...
Follow the first three steps above (in Modifying field behavior) to access the field configuration whose fields you wish to hide or show....
Read more >
Do I need to add hidden fields for the whole model when ...
Your form contains only the field names Id and Email , so only these values will be send back to the webserver (and...
Read more >
Hiding Fields & Field Visibility - Airtable Support
One of the core features of views is the ability to hide specified fields (columns, in grid views). When a field is hidden,...
Read more >
Removing and Hiding Custom Fields - Wrike Help Center
In the list, right-click the custom field. Select Remove from this folder/project. After you complete the steps, the field will be no longer...
Read more >
How to Show or Hide Fields on Edit URL - Jotform
Add a status on the user's submissions; Add additional details; Update admin-only fields; Hide fields that you do not wish to be updated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found