使用json嵌套数据中的行颜色导出具有可扩展行的表

时间:2017-08-28 17:09:08

标签: javascript jquery html html5 bootstrap-modal

public static bool CopyDir(string sPath, string dPath)
{
    try
    {
        DirectoryInfo spdi = new DirectoryInfo(sPath);
        spdi.Attributes &= ~FileAttributes.ReadOnly;
        foreach (string dirPath in Directory.GetDirectories(sPath, "*",
            SearchOption.AllDirectories))
            Directory.CreateDirectory(dirPath);

        foreach (string newPath in Directory.GetFiles(dPath, "*.*",
            SearchOption.AllDirectories))
        { 
            File.SetAttributes(dPath, FileAttributes.Normal);
            File.Copy(sPath, newPath);
        }
        Directory.CreateDirectory(dPath);
        return true;
    }
    catch (UnauthorizedAccessException e)
    {
        MessageBox.Show("Attempt to copy failed. (UAC) Raw: "+e,"IO Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
        return false;
    }
}

1 个答案:

答案 0 :(得分:0)

var input_data = [ 
{'row0':
 [
{'color':'danger','item1':'value1','item2':'value2','item3':'value3'},
{'color':'active','item4':'value4','item5':'value5','item6':'value6'}
]},
{'row1': 
[{'color':'danger','item7':'value7','item8':'value8','item9':'value9'},
{'color':'active','item10':'value10','item11':'value11','item12':'value12'}
]} 
];

现在你可以在input_data.length上尝试lopping并使用它。