# Is it possible to define treeview as default in object field?

**URL:** <https://discourse.getcockpit.com/t/is-it-possible-to-define-treeview-as-default-in-object-field/1642>\
**Category:** Support\
**Created:** [September 21, 2020, 1:47pm UTC](https://discourse.getcockpit.com/t/is-it-possible-to-define-treeview-as-default-in-object-field/1642 "2020-09-21T13:47:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tommueller](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tommueller](https://discourse.getcockpit.com/u/tommueller)\
**Post date:** [September 21, 2020, 1:47pm UTC](https://discourse.getcockpit.com/t/is-it-possible-to-define-treeview-as-default-in-object-field/1642/1 "2020-09-21T13:47:30Z")

</div>

Hello,

our customers prefer to use the ‘treeview’ when editing content in an Object-field.  
Is it possible to activate this by default, so that they don’t have to select it first?

Thanks  
Tom

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [September 21, 2020, 4:59pm UTC](https://discourse.getcockpit.com/t/is-it-possible-to-define-treeview-as-default-in-object-field/1642/2 "2020-09-21T16:59:05Z")

</div>

The fastest way would be to copy the core field into `path/to/cockpit/config/tags/field-object.tag` to overwrite it and to change that line in the modified field tp `mode: 'tree'`.

> <https://github.com/agentejo/cockpit/blob/next/modules/Cockpit/assets/components/field-object.tag#L29>

Another option would be to send a pull request with a similar behavior like the wysiwyg field or the html field to provide a javascript event to modify the default options before initialization.

---

<div class="post-metadata">

**Author:** ![tommueller](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tommueller](https://discourse.getcockpit.com/u/tommueller)\
**Post date:** [September 22, 2020, 9:29am UTC](https://discourse.getcockpit.com/t/is-it-possible-to-define-treeview-as-default-in-object-field/1642/3 "2020-09-22T09:29:22Z")

</div>

Thanks @raffaelj the first solution worked like charme!
