I have a function which returns a string from a function. This works well.
I then parse this string to return a new string which I can then output.
I want to display this as my title in the toolbar, however I cannot work out how to write the “value” in the toolbar_data.
table_last_update = getLastUpdate();
last_update_parsed = table_last_update.responseText.substring(table_last_update.responseText.indexOf(":")+2,table_last_update.responseText.indexOf(",")-1)
^ This part works fine
var toolbar_data = [{
id: “refresh”,
value: “Refresh Data”,
type: “button”
},
{
type: “separator”
},
{
type: “title”,
id: “last_update”,
value: “eval(“last_update_parsed”)”
}];var toolbar = new dhx.Toolbar("toolbar", { css: "dhx_widget--bordered dhx_widget--bg_gray" }); toolbar.data.parse(toolbar_data);
^ This now errors out, and will not display anything. I can write text in the “value” section and this will display fine, but as soon as I use eval for the variable it fails.
Many thanks,
Ewan