Thursday, 13 April 2017

how to access to json fields with webix and get data

I'm beginner with webix, Just started to link with mongodb. Now, I started loading my data from my DB. But when it comes to deal with Objects, I can't get the data.

 webix.ready(function () {


    var grida = webix.ui({
      container: "testA",
      id: "pivot", url: "/rent", save: "rest->/rent",
      view: "pivot",
      height: 400,
      width: 1000,

      max: true,
      structure: {
        rows: ["from"],
        columns: ["created"],
      }

    });

  });

and this is my json field.

 "from" : {
        "agency" : ObjectId("554"), 
        "place" : ObjectId("554dc4"), 
        "date" : ISODate("2014-08-09T06:00:00.000+0000"), 
        "completed" : false
    }, 

First, how to access to the data inside the object? and second, how to getYear of "created".

Thanks for your help :)



via Amine Haddar

No comments:

Post a Comment