Hi,
I have a GUI where an user inputs a store number. The program then reads various files and creates a variable which store the desire data into an object. I then want to show that data in a datatable. This is not working. Here is what the object looks like before the data is stored in it.
var rossObj = {
"store_number":{"store_number":""},
machines:[]
}
I store the desire data in the machines array. The data in the firefox using firebug console looks like this
Object { id=1, EQUIPMENT="Cash Office", MAC_ADDRESS=" 34-17-EB-AE-1F-0D\\r"}
Object { id=2, EQUIPMENT="ISP", MAC_ADDRESS=" C8-1F-66-FB-9E-92\\r"}
Object { id=3, EQUIPMENT="ISP", MAC_ADDRESS=" C8-1F-66-FB-9E-91\\r"}
To show the able I call a function that has the following code
function populateTable(rossObj){
webix.ready(function(){
//display table
var gridB = new webix.ui({
container:"areaB",
view:"datatable",
css:"my_style",
select:"cell", //allow cell selection
multiselect:true, //allow for multiple cells selectin
clipboard:"selection", //allow to copy to clipboard
headermenu:true,
columns:[
{ id:"EQUIPMENT", header:"EQUIPMENT", sort:"string", width:150, height:50},
{ id:"MAC_ADDRESS", header:"MAC ADDRESS", sort:"string", width:150, height:50}
],
data:rossObj.machines,
autoheight:true,
autowidth:true,
}); //end var gridB =
});//end webix.ready
}
what could be the problem. no error is shown. I’m thinking the formatting must be wrong. Even though firefox shows the data as
Object { id=2, EQUIPMENT=“ISP”, MAC_ADDRESS=" C8-1F-66-FB-9E-92\r"}, when i store it I store it using the following code
rossObj.machines.push({
"id": idCounter,
"EQUIPMENT" : equipment,
"MAC_ADDRESS" : macAddr
});
++idCounter;
Is it the json formatting that is wrong?Could it be that I’m missing a parameter in the datatable viewer? I’m pretty sure my object is global.