How To Overwrite getValue Method For Combo Control?

I would like to overwrite a getValue method by creating custom combo control, so that i can configure displayField and valueField and on getValue method, i will get the valueField value instead of "id" property value which is default behavior. Please find the snippet @
Waiting for the reply.
Ranjith G.



  • edited September 2017


    For your needs you should not only rewrite the getValue method, but also tune input and list templates, so that they can display the "displayField" correctly. Also, you will need to adjust filtering, so that the list is filtered by the displayed value.

    Check the following snippet, please:

  • Hi Helga,
    Can you please help me why the selected item is not getting highlighted in the dropdown in the snippet you have shared "" ?

    Ranjith G.

  • Hi,
    I got the solution i need to maintain the valuefield and id value same. By this the highlighting of selected item happens. Please find the snippet

    There is another way as well, we have to overwrite getMasterValue method of suggest, and return the value the way id will be.

    Ranjith G.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!