I want to put a variable in the property name, but I get an error.
The code is as follows.
Is there any good way?
Thank you for your cooperation.
var overrideCtx={};
overrideCtx.Templates={};
for(vari=1;i<=127;i++){
var hoge="";
hoge+="Test";
hoge+=i
overrideCtx.Templates.Fields={
hoge: {'DisplayForm': ConvertIcon}
};
Use Property Name
to access object properties.
var overrideCtx={};
overrideCtx.Templates={};
overrideCtx.Templates.Fields={};
for(vari=1;i<=127;i++){
var hoge="";
hoge+="Test";
hoge+=i
overrideCtx.Templates.Fields [hoge] = {value:hoge};
}
© 2024 OneMinuteCode. All rights reserved.