我编写了一个jquery,通过将硬编码值分配给变量来获取数据。
我的要求是从json文件中获取相同的数据,任何人都可以通过此代码来帮助我。请在下面找到代码:
$(function () {
var jsonCalendarTreeStructure = [
{
text: 'Years',
nodes: [
{
text: '2013',
type: 'Y',
nodes: [
{
text: '13-Q1',
type: 'Q',
},
{
text: '13-01',
type: 'M',
},
{
text: '13-02',
},
{
text: '13-03',
}
]
}
]
}
];
$('#Dyanmic').treeview({
data: jsonCalendarTreeStructure,
});
}
Run Code Online (Sandbox Code Playgroud)