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

Jayesh Goyani
  • 11,008
  • 11
  • 30
  • 50
ManirajSS
  • 2,295
  • 5
  • 26
  • 50

1 Answers1

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.

ruffin
  • 16,507
  • 9
  • 88
  • 138
Jayesh Goyani
  • 11,008
  • 11
  • 30
  • 50
  • +1, just consider Telerik guys say don't use **_properties** they are just for widget usage not for programmers. – Iman Mahmoudinasab May 07 '14 at 13:01
  • why should not use _properties? and instead of _properties what we have to use??? appreciate your help.. – ManirajSS May 08 '14 at 06:16
  • dataSource._data and dataSource.data() both are return same result. _data is property and data() is method. – Jayesh Goyani May 08 '14 at 06:18
  • 2
    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) ? – boyomarinov Apr 07 '16 at 11:39