代码之家  ›  专栏  ›  技术社区  ›  Tom

剑道UI下拉控件不显示集合中的所有值

  •  0
  • Tom  · 技术社区  · 7 年前

    [{
        "RANK_ORDER":20,
        "NAME":"Illiquid",
        "IS_ACTIVE":true,
        "SORT_ORDER":20,
        "ID":134,
        "DATE_CREATED":"2018-06-13T09:07:09",
        "LAST_MODIFIED":"2018-06-13T09:07:09",
        "CREATED_BY_ID":96,
        "LAST_MODIFIED_BY_ID":96
    }, {
        "RANK_ORDER":1,
        "NAME":"Invested",
        "IS_ACTIVE":true,
        "SORT_ORDER":1,
        "ID":1,
        "DATE_CREATED":"2014-02-04T12:50:20",
        "LAST_MODIFIED":"2014-10-23T22:56:37",
        "CREATED_BY_ID":52,
        "LAST_MODIFIED_BY_ID":338
    }, {
        "RANK_ORDER":9,
        "NAME":"Not Evaluated",
        "IS_ACTIVE":true,
        "SORT_ORDER":4,
        "ID":9,
        "DATE_CREATED":"2014-02-12T10:10:39",
        "LAST_MODIFIED":"2018-08-22T10:49:48",
        "CREATED_BY_ID":52,
        "LAST_MODIFIED_BY_ID":96
    }, {
        "RANK_ORDER":4,
        "NAME":"Prospective",
        "IS_ACTIVE":true,
        "SORT_ORDER":3,
        "ID":6,
        "DATE_CREATED":"2014-02-04T12:50:20",
        "LAST_MODIFIED":"2018-08-22T10:49:50",
        "CREATED_BY_ID":52,
        "LAST_MODIFIED_BY_ID":96
    }, {
        "RANK_ORDER":8,
        "NAME":"Prospective - Inactive",
        "IS_ACTIVE":true,
        "SORT_ORDER":7,
        "ID":8,
        "DATE_CREATED":"2014-02-04T12:50:20",
        "LAST_MODIFIED":"2018-08-22T10:49:50",
        "CREATED_BY_ID":52,
        "LAST_MODIFIED_BY_ID":96
    }, {
        "RANK_ORDER":7,
        "NAME":"Redeemed",
        "IS_ACTIVE":true,
        "SORT_ORDER":11,
        "ID":106,
        "DATE_CREATED":"2014-09-09T18:51:12",
        "LAST_MODIFIED":"2014-10-23T22:56:38",
        "CREATED_BY_ID":338,
        "LAST_MODIFIED_BY_ID":338
    }, {
        "RANK_ORDER":2,
        "NAME":"Redeeming",
        "IS_ACTIVE":true,
        "SORT_ORDER":5,
        "ID":4,
        "DATE_CREATED":"2014-02-04T12:50:20",
        "LAST_MODIFIED":"2014-10-23T22:56:37",
        "CREATED_BY_ID":52,
        "LAST_MODIFIED_BY_ID":338
    }]
    

          <label for="inputOffice" class="col-md-2 col-form-label ">Investment Status</label>
          <div class="col-md-4">
            <div *ngIf="!EditMode">{{FundDetails?.InvestmentStatusName}}</div>
               <kendo-dropdownlist *ngIf="EditMode" style="width:100%" [(ngModel)]="FundDetails.InvestmentStatusId"
                            class="form-control form-control-sm" [data]="FundDetails.InvestmentStatuses"
                            [filterable]="false" textField="NAME" [valuePrimitive]="true" valueField="ID">
              </kendo-dropdownlist>
           </div>
         </div>
    

    部件代码

    getFundDetails(selectedFundId: number) {
            // Initialize fundid to 0 to test new fund
            // selectedFundId = 0;
    
            if (selectedFundId != null) {
                this.fundService.getFundDetails(selectedFundId).subscribe((data: IFund[]) => {
                    // data.forEach((d) => {d.InceptionDate = new Date(d.InceptionDate); });
                    this.FundDetails = data;
                    this.OriginalFundStrategiesList = this.FundDetails.FundStrategies;
                    this.SelectedFundId = this.FundDetails.FundId;
    
                    // if ( this.SelectedFundId === 0) {
                    //     this.resetForm();
                    // }
                });
            }
        }
    

    接口

    export interface IFund {
        FundId: number;
        FundName: string;
        IsAnonymous: boolean;
        BloombergTicker: string;
        InvestmentStatusId: number;
        InvestmentStatusName: string;
        FlagShipFundId: number;
        InceptionDate: Date;
        AccountMandateId: number;
        AccountMandateName: string;
        VehicleTypeId: number;
        VehicleTypeName: string;
        PrimaryClassId: number;
        PrimaryClassDescripton: string;
    }
    

    我甚至尝试过使用剑道降下的本地属性,但没有运气

     <kendo-dropdownlist  k-ng-model="FundDetails.VehicleTypeId"
                        k-data-text-field="'NAME'"
                        k-value-primitive="true"                
                        k-data-value-field="ID"
                        k-data-source="FundDetails.VehicleTypes">
    
                    </kendo-dropdownlist>
    

    最新的更新是,我注释掉了所有的下拉框,只在屏幕上留下了一个。我可以看到下拉式渲染,但它在UI后面。所以我理解的是,这些值被正确绑定,但由于某种原因隐藏在UI中

    enter image description here

    0 回复  |  直到 7 年前
        1
  •  0
  •   Tom    7 年前

    这个问题已经解决了,因为我的css类是罪魁祸首。

    //z指数:10050!重要的;

    推荐文章