How to make grid observable

2 posts, 0 answers
  1. #CaughtUp#
    #CaughtUp# avatar
    4 posts
    Member since:
    May 2010

    Posted 17 Aug 2012 Link to this post

    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>

  2. Pechka
    Pechka avatar
    56 posts
    Member since:
    May 2010

    Posted 22 Aug 2012 Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top