How to manipulate elements that are inside a dialog

I have a create layout with a nuxeo-data-table and I would like to show/hide fields based on user input inside of the nuxeo-dialog but I am unable to.

    <nuxeo-data-table role="widget" items="{{document.properties.request:itemsToCreate}}" orderable="true" editable="true">
      <nuxeo-data-table-column name="Document Type">
        <template>
          <nuxeo-directory-suggestion role="widget" value="[[item.doc]]" readonly="true" directory-name="docType"></nuxeo-directory-suggestion>
        </template>
      </nuxeo-data-table-column>

      <nuxeo-data-table-column name="Asset Type">
        <template>
          <nuxeo-directory-suggestion role="widget" value="[[item.asset]]" readonly="true" directory-name="allType"></nuxeo-directory-suggestion>
        </template>
      </nuxeo-data-table-column>

      <nuxeo-data-table-column name="Description">
        <template>
          [[item.description]]
        </template>
      </nuxeo-data-table-column>

      <nuxeo-data-table-form>
        <template>
          <nuxeo-directory-suggestion id="type" role="widget" value="{{item.doc}}" label="Document Type" directory-name="docType" min-chars="0" required="true" on-value-changed="_calculateSubfields"></nuxeo-directory-suggestion>
          <nuxeo-directory-suggestion id="subtype" value="{{item.asset}}" label="Asset Type" directory-name$="{{subType}}" role="widget" min-chars="0" hidden$="{{!showSubTypeField}}" directory-name=""></nuxeo-directory-suggestion>
          <nuxeo-input label="Description" value="{{item.description}}" type="text"></nuxeo-input>
        </template>
      </nuxeo-data-table-form>
    </nuxeo-data-table>

  </template>

  <script>
    Polymer({
      is: 'nuxeo-items-to-create',
      behaviors: [Nuxeo.LayoutBehavior],
      properties: {
        subType: { type: String, value: ''},
        showSubTypeField: {type: Boolean, value: false},
        document: {
          type: Object
        }
      },
    _calculateSubfields: function(e) {
      var selection = e.detail.value;
      this.$.subtype.attributes['directory-name'].nodeValue = selection;
      this.showSubTypeField = true;
    }
```
this.$.subtype

is not defined.

0 votes

0 answers

195 views

ANSWER