This is a migrated thread and some comments may be shown as answers.

Combobox Virtualization on Init

1 Answer 74 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 31 May 2016, 12:30 PM

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

1 Answer, 1 is accepted

Sort by
0
Simon
Top achievements
Rank 1
answered on 31 May 2016, 01:56 PM
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.
Tags
ComboBox
Asked by
Simon
Top achievements
Rank 1
Answers by
Simon
Top achievements
Rank 1
Share this question
or