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

Get the JSON object (from the data source) when clicking the grid items

1 Answer 310 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Radoslav
Top achievements
Rank 1
Radoslav asked on 10 Sep 2011, 12:31 PM
Hello guys,
First - great UI framework :) I hope it goes well in the future.

Second - i have the following scenario :
01.$(document).ready(function() {
02.              var JsonDataSource = new kendo.data.DataSource({
03.                  transport: {
04.                      read: {
05.                          url: "jsonProvider.php", // the remove service url
06.                          dataType: "json"
07.                      }
08.                  }
09.              });
10.                
11.              JsonDataSource.read();
12.              console.log(JsonDataSource);
13.                
14.              $("#grid").kendoGrid({
15.                  dataSource : JsonDataSource,
16.                  columns : ["id", "name"],
17.                  selectable : true,
18.                  sortable : true,
19.                  change : function(event) {
20.                      console.log(this);
21.                      var selected = this.select();
22.                      console.log(selected.text());
23.                  },
24.                  dataBound : function() {
25.                      console.log("data loaded");
26.                  }
27.              });
28.          });

The JSON is super simple :
1.[{id : 1, name: "sth"}]

And when i click on a row, i got the following output :
1sth
What i want to do is to get the whole object (without doing dirty hacks)  when i click on the grid row and fire the onChange event.
Is this possible in Kendo ?

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 12 Sep 2011, 11:23 AM
Hi Radoslav,

Please take a look at this forum thread for a sample of similar functionality.

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!
Tags
Grid
Asked by
Radoslav
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or