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

Combobox with custom transport read en serverpaging

2 Answers 242 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Willem-Jan
Top achievements
Rank 1
Willem-Jan asked on 29 Sep 2017, 11:17 AM

I'm trying to create a Comboxbox with server side paging and a custom transport read, i can't get it to work so i made a small ex-sample.

If you run the example it isn't possible to scroll "below" the already loaded items, so there isn't another read to get the next 10 items

https://dojo.telerik.com/eHaJU/5

    $("#orders").kendoComboBox({
            dataTextField: "text",
            dataValueField: "value",
            dataSource: {
        serverPaging: true,
        schema: {
            data: "data",
            total: "total"
        },
        pageSize: 10,
        transport: {
            read: function(options) {
                var data = getData(options.data.page);
                options.success(data);
            }
        },
        update: function() {}
    }
});
 
function getData(page)
{
    var dataArr = [];
    for (var i = 0; i < 10; i++)
        dataArr.push({ text: "Item " + (i + 1) + " on page " + page, value: 1});
     
    return {data: dataArr, total: 100};
}

How can I make this work? Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Accepted
Joana
Telerik team
answered on 03 Oct 2017, 10:07 AM
Hi Willem-Jan,

Virtual setting needs to be enabled and custom paging should be implemented in order to achieve the described scenario. Here is a dojo sample which illustrate such implementation: https://dojo.telerik.com/aZOME/2

Let me know if you have further questions.

Regards,
Joana
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Willem-Jan
Top achievements
Rank 1
answered on 04 Oct 2017, 08:50 AM

Hi Joana,

thanks, that works.

Regards,
Willem-Jan

Tags
ComboBox
Asked by
Willem-Jan
Top achievements
Rank 1
Answers by
Joana
Telerik team
Willem-Jan
Top achievements
Rank 1
Share this question
or