Open aaroncreed opened 6 years ago
It would be really nice if you could recreate your issue on jsbin or jsfiddle. If that's not possible could you at least edit your code in a way that all of it is shown in code style, not only parts of it? In it's current form it is really hard to read. :)
Hi, good day
I tried to make a timeline with vis.js 4.21.0 and its work fine in GoogleChrome but in IE11 and EDGE disappeared all the content, load the json again and it still doing the same thing. If you play with them work fine but if you still insist in some one point the timeline become like this:
my code: ///json
//options with template
var options = { editable:{
},
template: function (item, element, data) {
var empr=""; if ($.trim(data.empresaa)) { empr=data.empresaa.n_empresa; }; var sucr=""; if ($.trim(data.sucursall)){ sucr=data.sucursall.n_suc;} var chf=""; if ( $.trim(data.choff)) {chf=data.choff.n_chofer;}
html=
},
// onMoving: function (item, callback) { // item.moving = true; // } };
var timeline = new vis.Timeline(container, items, options); // console.log("console log4 desoyes de crear el time line"); loadData(); function loadData () { // get and deserialize the data txtData = document.getElementById('data');
data = JSON.parse(txtData.value); /// console.log("log de load",data);
for(var k in data) { // console.log(k,data[k]);
for(var d in data[k]) {
if (d=="fecha_asignacion") { // console.log("entre a cambiar el formato",data[k][d]); var spt= data[k][d]; var car=spt.split("-",3); // console.log("resultado: ",car[0],car[1],car[2]); data[k]["start"]= new Date(""+car[0]+"/"+car[1]+"/"+car[2]+""); // data[k]["start"]= new Date(car[0],car[1],car[2],0,0,0); // console.log(k,d,"quepedo2", data[k]["start"]); }
} }
/// items.clear(); // console.log("que pedo",data); items.add(data);
// console.log("se agrego a items data");
} btnLoad.onclick = loadData;
function saveData() {
} // console.log("log6 fase final"); btnSave.onclick = saveData;
// load the initial data loadData();
});