jquery - How can i access to object elements in javascript? -
i'am using jquery gantt api, , want access elements, don't know how.
$(function() { "use strict"; //var obj = json.parse($(".gantt").gantt); $(".gantt").gantt({ source: [{ name: "sprint 0", desc: "analysis", values: [{ from: "/date(1320192000000)/", to: "/date(1322401600000)/", label: "requirement gathering", customclass: "ganttred" }] }], navigate: "scroll", scale: "weeks", maxscale: "months", minscale: "days", itemsperpage: 10, onitemclick: function(data) { alert("item clicked - show details"); }, onaddclick: function(dt, rowid) { alert("empty space clicked - add item!"); }, onrender: function() { if (window.console && typeof console.log === "function") { console.log("chart rendered"); } } }); //alert("ok"); //var parseddata = json.parse(); //alert($(".gantt").gantt.source); $(".gantt").popover({ selector: ".bar", title: "i'm popover", content: "and i'm content of said popover.", trigger: "hover" }); prettyprint(); });
i found ape static example, trying draw own chart changing content of element source. can tell me how can element source gantt object.
based on example, move source data variable can reference later:
var ganttsource = [{ name: "sprint 0", desc: "analysis", values: [{ from: "/date(1320192000000)/", to: "/date(1322401600000)/", label: "requirement gathering", customclass: "ganttred" }] }]; $(".gantt").gantt({ source: ganttsource, ... }); console.log(ganttsource);
Comments
Post a Comment