How to disable field checkbox on fields menu?

Answered
carrie asked on October 12, 2022

Hello,
I want to display some columns in the flat grid table all the time, which means the user cannot choose these fields from the field list to hide these columns.
I think of two solutions:
1. disable the columns checkbox on the fields menu;
2. hide the columns on the fields menu but show these columns in the grid table;
Is possible to achieve this demand?
Thanks

5 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster October 12, 2022

Hello, Carrie!
 
Thank you for reaching out to us.
 
Kindly note that our Field List is provided as-is. To achieve custom behavior, we suggest creating a custom Field List.
 
The algorithm for writing the custom Field List is the following:
 
1. Add a new tab to the Toolbar using the beforetoolbarcreated event.
Here is the JSFiddle example with adding a new tab: https://jsfiddle.net/flexmonster/m7e74ay4/.
You can find more details about customizing the Toolbar in our docs: https://www.flexmonster.com/doc/customizing-toolbar/.
 
2. (optional) Remove the existing Fields tab from the Toolbar and the configurator button from the upper right corner of the grid.
We have prepared the JSFiddle example for visualization: https://jsfiddle.net/flexmonster/q6082me3/.
 
3. Create your own Field List pop-up. 
You can use the dialogs section of our flexmonster/toolbar/flexmonster.toolbar.js file as a reference for styling.
 
4. Get all fields from the pivot table using the getAllHierarchies() API call:

let allFields = flexmonster.getAllHierarchies();

 The getAllHierarchies() API call returns an array of objects.
 
5. After that, your own functionality of disabling some fields should follow.
 
6. The final moment is to add functionality for the buttons:

  • For the Apply button, call the runQuery() API call.
    Here is a JSFiddle example showing how runQuery() can be used: http://jsfiddle.net/flexmonster/u0tr98aj/.
  • For the calculated values pop-up window, there is an openCalculatedValueEditor() API call. It can be called either for creating a new calculated value of for editing the existing one.
    Please look through the documentation for this API call for the examples: https://www.flexmonster.com/api/opencalculatedvalueeditor/.
  • For the Close button, your own custom functionality is also needed.

 
Here is also a list of all API calls: https://www.flexmonster.com/api/methods/.
 
We hope it helps. Feel free to contact us if any other questions arise.
 
Regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster October 19, 2022

Hello, Carrie!

Hope you are doing well.

Our team is wondering if you had some time to try the suggested approach and create a custom Field List pop-up.

Please let us know if you have any further questions.

Looking forward to hearing from you.

Regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster October 26, 2022

Hello, Carrie!

Hope you are having a great week.

Just checking in to ask if a custom Field List pop-up approach works for your case.

Looking forward to your response.

Regards,
Solomiia

Public
Melvin February 13, 2024

Hey Flexmonster team,
If we created a custom field list, will it affect future upgrades?.

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster February 14, 2024

Hello Melvin,

Thank you for the question.

Kindly note that creating a custom field list will not affect future upgrades if you use Flexmonster API calls and events.

We hope it helps. You are welcome to contact us in case other questions arise.

Kind regards,
Nadia

Please login or Register to Submit Answer