Combobox with custom transport read en serverpaging

3 posts, 1 answers
  1. Willem-Jan
    Willem-Jan avatar
    2 posts
    Member since:
    Sep 2017

    Posted 29 Sep Link to this post

    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. Answer
    Joana
    Admin
    Joana avatar
    128 posts

    Posted 03 Oct Link to this post

    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.
  3. Willem-Jan
    Willem-Jan avatar
    2 posts
    Member since:
    Sep 2017

    Posted 04 Oct in reply to Joana Link to this post

    Hi Joana,

    thanks, that works.

    Regards,
    Willem-Jan

Back to Top