extjs: How to l set value for combobox when loading

后端 未结 5 860
一向
一向 2021-01-14 11:24
  1. I am looking for a load listener, that when the combobox is up, load will be called and preform an ajax to the s

5条回答
  •  悲&欢浪女
    2021-01-14 11:58

    There is no load event for a combo.. hence the code you wrote is not getting executed. You already have a store defined with values.. are you trying to load new values to the store that is attached to the combo box? What do you mean by "combobox is up"?

    To load a combo box with values from the server, you only need to load the store. Refer to this article on how to load the combobox.

    ----------------------------------------- UPDATE -----------------------------------------

    1. Are you trying to load a form with values? In that case you can load the values using the load method available with the BasicFrom. Refer to this example. Even though it uses XML you can easily change to load data from JSON.

    2. In order to display label field, you need to set your layout property of your container as

      layout: 'form'

提交回复
热议问题