fields and item template

is it possible to pass fields and itemTemplate to the drop-down in-place editor.  I have tried  various ways, but short of just putting in an actual drop down control i have not been able to get this working.

I'm trying to do something like this:


<ejs-inplaceeditor
data-underline='false'
mode="Inline"
type="DropDownList"
:model="employees"
:fields="{text: 'name', value: 'id' }"
v-model:value="letterData.employeeName"
/>

 


2 Replies

BS Buvana Sathasivam Syncfusion Team March 1, 2022 03:40 AM UTC

Hi James, 
Currently, we are validating your reported query. We will update you with further details on or before March 3, 2022. 
  
Regards, 
Buvana S 



VJ Vinitha Jeyakumar Syncfusion Team March 4, 2022 09:57 AM UTC

Hi James,


You can pass the fields and itemTemplate to the dropdown in the In-PlaceEditor using model property. please check the code below,

Code snippet:
<template>
  <div id="app">
    <ejs-inplaceeditor
      id="gender"
      type="DropDownList"
      mode="Inline"
      value="Australia"
      :model="dropdownModel"
    ></ejs-inplaceeditor>
  </div>
</template>
<script>
var itemVue = app.component("itemTemplate", {
  data: () => ({}),
  template: `<span><span class='name'>{{data.Country.Name}}</span><span class ='city'>{{data.Code.Id}}</span></span>`,
});
export default {
  name: "App",
  components: {
    "ejs-inplaceeditor": InPlaceEditorComponent,
  },
  data: function () {
    return {
      dropdownModel: {
        dataSource: [.....  ],
        placeholder: "Select a country",
        fields: { text: "Country.Name", value: "Code.Id" },
        itemTemplate: function () {
          return { template: itemVue };
        },
      },
    };
  },
};
</script>


Regards,
Vinitha



Loader.
Up arrow icon