Combobox Virtualization on Init

2 posts, 0 answers
  1. Benjamin
    Benjamin avatar
    21 posts
    Member since:
    Apr 2015

    Posted 31 May Link to this post

    Hi,

    i have the following problem. I added virtualization functionality to my Odata-V4 API. Now I added the necessary options to the combobox (using Angular + Typescript) following the instructions from this article: 

    http://docs.telerik.com/kendo-ui/controls/editors/combobox/virtualization#itemheight

    private initLieferscheinNrCB()
            {
                this.dataSourceService.createDataSource('vwSalesLSAFMitZero').then((res: kendo.data.DataSource) =>
                {

                    this.LieferscheinNrCBDS = res;
                    this.LieferscheinNrCBDS.options.serverFiltering = true;
                    this.LieferscheinNrCBDS.options.serverPaging = true;
                    //this.LieferscheinNrCBDS.options.pageSize = 80;
                    this.LieferscheinNrCBOptions = {
                        dataSource: this.LieferscheinNrCBDS,
                        dataTextField: 'LSNr_Str',
                        dataValueField: 'LSNr',
                        height: 520,
                       
                        virtual:
                        {
                            itemHeight: 26,
                            valueMapper: (options) =>
                            {
                                this.$log.debug("LSCB Valuemapper");
                                this.odataService.callServer('POST', 'odata/vwSalesLSAFMitZero/Default.RowNumber()', {
                                    RowNumber: { Column: "LSNr", Value: options.value }
                                }).then((res: any) =>
                                {
                                    this.$log.debug("ValueMapper Res: ", res);
                                    options.success(res.value);
                                });
                            }
                        }
                    };
                });
            }

    <select id="vm.LieferscheinCB"
                                        kendo-combo-box="vm.LieferscheinNrCB"
                                        k-options="vm.LieferscheinNrCBOptions"
                                        k-ng-delay="vm.LieferscheinNrCBOptions"></select>

     

    The problem is, that everything works fine when I filter the items. But on the first load, there is no $top nor $skip in the server request, so all items get loaded. This is anoying :-(. Does anybody know this bug or also have a workaround?

     

    Best Regards

    Benjamin

  2. Benjamin
    Benjamin avatar
    21 posts
    Member since:
    Apr 2015

    Posted 31 May in reply to Benjamin Link to this post

    I just found the failure on my own. My Service which creates the Datasource for me, does not configure the paging, and when I add the properties to it, the DS get already read.
  3. Kendo UI is VS 2017 Ready
Back to Top