No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    QSELECT dynamic model

    Framework
    2
    4
    555
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      JJ last edited by

      I have a QSelect whose model and options depend on a dynamic property:

      <q-item-section>
      	<template v-if="property.AvailableValues.length > 0">
      		<q-select dense                                                                    
      				  v-model="property.Value"
      				  label="test"
      				  :options="property.AvailableValues"
      				  option-value="Value"
      				  option-label="Text"
      				  options-dense
      				  map-options
      				  emit-value
      				  use-input
      				  input-debounce="0"
      				  @@filter="filterAvailableValues"
      				  @@new-value="createContentPropertyValue">
      		</q-select>
      	</template>
      	<template v-else>
      		<q-input dense v-model="property.Value" label="Property string Value"></q-input>
      	</template>
      </q-item-section>
      

      Using text box, I want to add new value if not present into the “property.AvailableValues”. To do this I have to use the event @@new-value, and push the new value into options array/list.
      But how can I do that, since options list (property.AvailableValues) is dynamic (i.e. not present in vue data)?

      dobbel 1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel @JJ last edited by dobbel

        @jj said in QSELECT dynamic model:

        But how can I do that, since options list (property.AvailableValues) is dynamic (i.e. not present in vue data)?

        You mean the property.AvailableValues is defined in it’s parent component? If not where is it defined?

        1 Reply Last reply Reply Quote 0
        • J
          JJ last edited by

          Yes it is defined in it’s parent component

          dobbel 1 Reply Last reply Reply Quote 0
          • dobbel
            dobbel @JJ last edited by

            @jj

            If you want better support please create a working codepen.io that demo’s your problem.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post