更改组合框分页后,getValue和getRawValue返回相同的值

after change Combobox pagination, getValue and getRawValue returned the same value

本文关键字:返回 getRawValue getValue 组合 分页      更新时间:2023-09-26

我使用Ext js 3.4组合框查找器
假设组合框的存储使用分页。

首先,当我选择某个项目时,它会给出例如:getValue()=>1000和getRawValue()>>"项目名称",但在我更改分页(不选择任何项目)后,getValue(。

有人能帮我吗?

Combobox = Ext.extend(Ext.form.ComboBox, {
  allowBlank: false,
  autoSelect: false,
  baseParams: {},
  cls: "remote-server-finder",
  displayField: 'name',
  emptyText: "",
  forceSelection: false,
  itemSelector: 'div.remote-server-finder-item',
  minChars: 0,
  pageSize: 10,
  queryDelay: 10,
  store: null,
  triggerAction: 'all',
  typeAhead: true,
  valueField: 'id',
  minListWidth: 235,
  maxHeight: 400,
  /**
   * Setup the data store and template for the finder.
   */
  initComponent: function () {
    this.blankText = helpsys.locale.javascript.field_required;
    this.loadingText = helpsys.locale.common.searching;
    this.listEmptyText = helpsys.locale.javascript.no_matching_record;
    this.store = new Ext.data.JsonStore({
      baseParams: this.baseParams,
      fields: [
        {
          name: 'id'
        },
        {
          name: 'name'
        },
        {
          name: 'description'
        },
        {
          name: 'type'
        }
      ],
      idProperty: 'id',
      proxy: new Ext.data.HttpProxy({
        url: this.url,
        method: 'GET',
        listeners:{
            beforeload:{
                scope:this,
                fn:function(dp, params){
                    if(dp.activeRequest['read']){
                        dp.activeRequest['read'].conn.abort();
                    }
                }
            }
        }
      }),
      root: 'items',
      totalProperty: "totalResultsAvailable"
    });
    this.tpl = new Ext.XTemplate('<tpl for="."><div class="remote-server-finder-item finder-item x-combo-list-item">',
      '<div class="remote_server_finder_text finder_text">', '<h2 class="name">{name}</h2>', '<p class="description">{description}</p>', '</div>', '</div></tpl>');
    );
  }