_pristine vs _pristineData in kendo dataSource
Asked Answered
B

1

7

In my understanding kendo dataSource have many _properties. But im unclear about their unique characteristics.

can anybody explain difference among these kendo dataSource properties.

1. _pristine

2. _pristineData

3. _data

4. _view

5. dataSource.data()

most of the times all are looks like same to me and having same data.

First four having same records as in database.But dataSource.data() having unsaved record also (i.e updated with edit value).

In kendo docs i cant find exact difference among these things.

pls explain unique characteristics of these five ( _pristine, _pristineData, _data, _view, dataSource.data() )

Thanks in Advance

Bluet answered 6/5, 2014 at 19:56 Comment(0)
C
7

Please check my comments for first four points.

  1. _pristine

    I am not able to find this. I have also attached a screenshot for this. You can also check it by using below code snippet in your browser's console window.

    $("#grid").data("kendoGrid").dataSource

  2. _pristineData

    Store your original data. This data is used in a batch update. When we click on "Cancel changes" button at that time the Grid will take the original data from here.

  3. _data

    Displayed currently applied data. If you change data in the grid then it will be applied into this data.

  4. _view

    Based on your pagesize and pageindex; this is whatever is databound to your grid. Ex: If you've bound 100 records to your grid but your page size is 10, then it will return only 10 records based in your page-index. enter image description here.

Contingency answered 7/5, 2014 at 9:40 Comment(4)
+1, just consider Telerik guys say don't use _properties they are just for widget usage not for programmers.Braasch
why should not use _properties? and instead of _properties what we have to use??? appreciate your help..Bluet
dataSource._data and dataSource.data() both are return same result. _data is property and data() is method.Contingency
I agree about not using such internal properties. Though, if I need the original data, is there a function to retrieve it (instead of using the _pristineData property) ?Riorsson

© 2022 - 2024 — McMap. All rights reserved.