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

Ranges

7 Answers 215 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Oskar
Top achievements
Rank 1
Oskar asked on 21 Sep 2011, 11:35 AM
Hello everyone!

I would like to know for what we have 'ranges' in DataSource, and when/where we are using it.

Cheers!

7 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 21 Sep 2011, 12:50 PM
Hi Oskar,

Currently, the dataSource ranges feature is used internally by the virtualization functionality. It is used to retrieve a range of records which may by across multiple pages of data. 

Best wishes,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Oskar
Top achievements
Rank 1
answered on 21 Sep 2011, 02:01 PM
Hi Rosen,

I have found that this ranges are created during scrolling up with wheel only. Function which render each page during scrolling uses _findRange method. When we for example sort all rows by column and start to scroll rows are taken from raw unsorted data and then sorted. When we sort data before getting any rows from ranges object or after sort we will put this data into it, virtual scrolling will probably work.

What do you think?

Oskar.

//Edit:

Creating multiple range objects can provoke memory leak. Every time, when I scroll up 10 elements, new object in ranges array is created, with additional redundant data in it. Is it necessary to create that elements each time when we scroll up?

[Object { start=0, end=10000, data=[10000]}, Object { start=6660, end=16660, data=[10000]}, Object { start=6670, end=16670, data=[10000]}, Object { start=6680, end=16680, data=[10000]}, Object { start=6690, end=16690, data=[10000]}, Object { start=6700, end=16700, data=[10000]}, Object { start=6710, end=16710, data=[10000]}, Object { start=6720, end=16720, data=[10000]}, Object { start=6730, end=16730, data=[10000]}, Object { start=6740, end=16740, data=[10000]}, Object { start=6750, end=16750, data=[10000]}, Object { start=6760, end=16760, data=[10000]}, Object { start=6770, end=16770, data=[10000]}, Object { start=6780, end=16780, data=[10000]}, Object { start=6790, end=16790, data=[10000]}, Object { start=6800, end=16800, data=[10000]}, Object { start=6810, end=16810, data=[10000]}, Object { start=6820, end=16820, data=[10000]}, Object { start=6830, end=16830, data=[10000]}, Object { start=6840, end=16840, data=[10000]}, Object { start=6850, end=16850, data=[10000]}, Object { start=6860, end=16860, data=[10000]}, Object { start=6870, end=16870, data=[10000]}, Object { start=6880, end=16880, data=[10000]}, Object { start=6890, end=16890, data=[10000]}, Object { start=6900, end=16900, data=[10000]}, Object { start=6910, end=16910, data=[10000]}]

I thnik I have fixed Virtual Scrolling with grouping and sorting, just need to improve it when we want to reset grouping/sorting. After that i will post my codes here.
0
Rosen
Telerik team
answered on 26 Sep 2011, 12:52 PM
Hello Oskar,

When virtualization feature is used it will be most appropriate for sorting to be done on the server as otherwise dataSource will not be able to sort data correct as only portions of data are available on the client.

Also I have noticed that you are loading quite a large pages of data, which generally is not good idea, therefore you may consider constraining the page size to a lower number.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Oskar
Top achievements
Rank 1
answered on 26 Sep 2011, 01:51 PM
Hi Rosen,

I'm loading whole data (10k records) direct to client memory, so I'm using local virtualization, then I'm rendering each page with your algorithms. In fact I just don't need to load each page from server with for example ajax. I agree that plenty of data should be grouped / sorted on backend side, but I think new web browsers should handle 10k record easy. I have found out that for local virtualization grouping/sorting (probably filtering too) don't work, in addition when we are scrolling up every 10 records (10 - set pageSize) methods create many objects called 'range' (with whole data in it). I have fixed sorting and grouping. Now I'm fighting with datagrid fixed size + group collapsing (since when we collapse group free space appears under grouping row).

Regards,
Oskar.
0
Rosen
Telerik team
answered on 28 Sep 2011, 12:39 PM
Hello Oskar,

Could you please provide a bit more details about how data is loaded and dataSource is configured? Maybe you can send us a small sample or http://jsfiddle.net page demonstrating your scenario.

Please note that currently, grid's grouping functionality is not supported when virtualization is enabled.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Oskar
Top achievements
Rank 1
answered on 28 Sep 2011, 12:51 PM
Attached below my dataGrid config:
$.getJSON('http://urlToSource/buffer.txt'nullfunction(jsondata) {
    var test = $("#grid2").kendoGrid({
        dataSource: {
            data: jsondata,
            pageSize: 20
        },
        sortable: {
            mode: "multiple",
            allowUnsort: true
        },
        scrollable: {
            virtual: true
        },
        groupable: true,
        columns: ["id""col1""col2""col3""col4""col5"],
        height: 450
    });
});
I'm using local data virtualization with 10k of records.
0
Rosen
Telerik team
answered on 30 Sep 2011, 10:29 AM
Hello Oskar,

Thanks for the additional details. We were able to recreate the multiple ranges issue and will address it for the next release of the component.

All the best,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Oskar
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Oskar
Top achievements
Rank 1
Share this question
or