Results 1 to 3 of 3

Thread: combo box foreceSelect

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    81
    Answers
    2

    Default combo box foreceSelect

    am using a combobox with forecSelect:true, multiSelect:false, when i record which is not in the list is givien to the combo it will set the last selected value but at start it will set to NULL..... what i wanted is to always set to NULL or empty when the value is not from the list..... or when cam i overide this thing
    lastSelected=[];

  2. #2
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106

    Default

    From looking at the source, it appears that lastSelected is only set when autoSelect: true. You can most likely override the doAutoSelect method to get what you're after.

    As an alternative, you might be able to listen for the change and select events and reset the lastSelected property there.

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    81
    Answers
    2

    Default i tried

    loking through the source i tried to change a line

    <code>

    assertValue: function() {
    var me = this,
    value = me.getRawValue(),
    NullValue="select";
    rec;

    if (me.forceSelection) {
    if (me.multiSelect) {
    // For multiselect, check that the current displayed value matches the current
    // selection, if it does not then revert to the most recent selection.
    if (value !== me.getDisplayValue()) {
    me.setValue(me.lastSelection);
    }
    } else {
    // For single-select, match the displayed value to a record and select it,
    // if it does not match a record then revert to the most recent selection.
    rec = me.findRecordByDisplay(value);
    if (rec) {
    me.select(rec);
    } else {
    me.setValue(me.lastSelection);******* i have changed this line to me.setValue(""); ***** but nuthing has changed what shall i do ? or please show me some example how to overide this thing******
    }
    }
    }
    me.collapse();
    },

    </code>

Posting Permissions

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