Problems rendering data list correctly with Combobox - showing [object Object] list

1 Answer 45 Views
ComboBox DropDownList
Infraestructura TI
Top achievements
Rank 1
Infraestructura TI asked on 27 Dec 2023, 03:09 PM

Problems with the "Field > Combobox" component when passing all the data, label and component properties to it, no problem, but when I add "textField" the combobox gives me a list of [object Object]. Maybe I'm passing the properties wrong, could you give me some clue? 

I have the list of "moneda" that is passed in data through the API.

In the attached image you can see that it loads the list with the value of 'CLP' which is correct and you see the [Object object] list. Greetings

   const [currency, setCurrency] = useState([]);

   useEffect(() => {
     (async() => {
       const currency = await getDefiCurrencies();

       setCurrency(currency);
     })();
   }, []);

---------------Edit Form --------------------------
                   <Field
                     id={'CodiMone'}
                     name={'CodiMone'}
                     label={'Currency'}
                     component={FormComboBox}
                     // textField={'CodiMone'}
                     data={currency}
                   />

      

1 Answer, 1 is accepted

Sort by
1
Accepted
Konstantin Dikov
Telerik team
answered on 28 Dec 2023, 07:11 PM

Hello,

If the "CodiMone" is a string of numeric value within the items of the "currency" array, the data would be displayed correctly if the textField is set. You can take a look at the FormComboBox configuration in the following example:

You will notice that the textField is set to "label", which points to the label value of the items in the data:

export const genders = [
  {
    label: "Male",
    value: "male",
  },

If further assistance is needed, please share a stackblitz example demonstrating the issue, so we can debug it locally. 

 

Regards,
Konstantin Dikov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Tags
ComboBox DropDownList
Asked by
Infraestructura TI
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or