Results 1 to 4 of 4

Thread: How to detect if a combo value is from selection

  1. #1
    Sencha Premium User filippo.ferrari's Avatar
    Join Date
    Apr 2010
    Location
    Sanremo - Italy
    Posts
    135
    Answers
    2

    Default Answered: How to detect if a combo value is from selection

    Hi, I've a combox with force selection to false, I need two different actions if combo value comes from selection or not.

    Any suggest?

    Filippo

  2. A selection *must* exist in the store which is bound to the combobox, so you should be able to use the findRecordByValue() method of the combobox itself: http://docs.sencha.com/extjs/4.2.1/#...dRecordByValue

    If it returns a record, you know you've found a record in the combobox list's store that matches the current value of the combobox. If it returns false, you know you have a non-record bound value.

  3. #2
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Answers
    32

    Default

    A selection *must* exist in the store which is bound to the combobox, so you should be able to use the findRecordByValue() method of the combobox itself: http://docs.sencha.com/extjs/4.2.1/#...dRecordByValue

    If it returns a record, you know you've found a record in the combobox list's store that matches the current value of the combobox. If it returns false, you know you have a non-record bound value.
    Before pasting your code, see if you can make a working example using Sencha Fiddle: https://fiddle.sencha.com/

    Not only will it let everyone see what you're talking about with their own eyes, but it also makes debugging your issue 19 billion times easier

    Embedding your newly created Fiddle is super-easy: Using Sencha Fiddle in the Forums

  4. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    574
    Answers
    59

    Default

    Or simpler - check combo.valueModels.

  5. #4
    Sencha Premium User filippo.ferrari's Avatar
    Join Date
    Apr 2010
    Location
    Sanremo - Italy
    Posts
    135
    Answers
    2

    Default

    Quote Originally Posted by existdissolve View Post
    A selection *must* exist in the store which is bound to the combobox, so you should be able to use the findRecordByValue() method of the combobox itself: http://docs.sencha.com/extjs/4.2.1/#...dRecordByValue

    If it returns a record, you know you've found a record in the combobox list's store that matches the current value of the combobox. If it returns false, you know you have a non-record bound value.
    Perfect! Tanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •