Hi All,
As I can't found a VisJS wrapper, I'm testing to include directly a javascript in a container in the property html.
I use a XTemplate to fill data but nothing work.
I mean nothing is shown.
It seams that nothing is executed inside script tag.
I think it's not the best solution to include a script in a container but I would like to provide a temporary functionnality until I develop the wrapper.
Many thank for your help !
My XTemplate is:
Code:
TplTimeLine : new Ext.XTemplate(
'<head>',
'<link rel="stylesheet" type="text/css" href="https://..../application/ux/VisJS/dist/vis.css">',
'<script type="text/javascript" src="https://..../application/ux/VisJS/dist/vis.js"></script>',
'</head>',
'<body>',
'Under Testing',
'<div id="visualization"></div>',
'<script type="text/javascript">',
' var container = document.getElementById("visualization");',
' var items = new vis.DataSet([',
' {id: 1, content: "item 1", start: "2013-04-20"},',
' {id: 2, content: "item 2", start: "2013-04-14"},',
' {id: 3, content: "item 3", start: "2013-04-18"},',
' {id: 4, content: "item 4", start: "2013-04-16", end: "2013-04-19"},',
' {id: 5, content: "item 5", start: "2013-04-25"},',
' {id: 6, content: "item 6", start: "2013-04-27"}',
' ]);',
' var options = {};',
' var timeline = new vis.Timeline(container, items, options);',
'</script>',
'</body>'
)
My view:
Code:
Ext.define("PP.view.sheet.TimeLine", {
extend : 'Ext.container.Container',
alias : 'widget.timeline',
style : { backgroundColor:'#FFFFFF'},
padding : '10px',
layout : 'border',
autoScroll : true,
html : '<div id="mytimelinesheet"></div>'
});
My part of controller:
Code:
onTimeLineRendered: function() {
this.refreshTimeLineSheet(this.application.currentRecord);
},
refreshTimeLineSheet: function(aRecord) {
var el = Ext.get("mytimelinesheet");
PP.util.Templates.TplTimeLine.overwrite(el, aRecord.data);
}