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

How to make grid observable

1 Answer 176 Views
Grid
This is a migrated thread and some comments may be shown as answers.
#CaughtUp#
Top achievements
Rank 1
#CaughtUp# asked on 17 Aug 2012, 05:16 AM
Hi,
I am trying to load a kendo grid using Json Data coming from a controller. I would like to know how I can make my viewmodel grid observable. Please find my view model code below:

function

 

 

initControls() {

$(

 

"#ChargesGrid").kendoGrid({

dataSource: {

type:

 

"json",

transport: {

read: {

url:

 

"Charge/GetCharges",

dataType:

 

"json",

type:

 

"POST"

}

},

pageSize: 5

},

groupable:

 

false,

sortable:

 

true,

pageable: {

refresh:

 

false,

pageSizes:

 

true

},

columns: [

{ field:

 

"Description", title: resourcesSet.str_Desc, width: "150px" },

{ field:

 

"Amount_Due", title: resourcesSet.str_AmtDue, width: "50px" },

{ field:

 

"Date", title: resourcesSet.str_Date, width: "50px" },

{ field:

 

"Title", title: resourcesSet.str_Title, width: "150px" },

{ command: { text:

 

"Edit", click: showForm }, title: " ", width: "80px"}]

});

 

 

 

}



This is my html rendering the grid
<table id="ChargesGrid"></table>

1 Answer, 1 is accepted

Sort by
0
Pechka
Top achievements
Rank 1
answered on 22 Aug 2012, 06:39 AM
Hi,

What exactly you are trying to achieve? The underlying collection which the dataSource of the Grid uses is observable. And changing the properties via the set/get methods will update the UI.

Regards,
Pechka
Tags
Grid
Asked by
#CaughtUp#
Top achievements
Rank 1
Answers by
Pechka
Top achievements
Rank 1
Share this question
or