Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

how to run command stored as a string other than eval()

$
0
0

hi,

my code looks like this:

function getById(ID){

    var returnArray=[];

    for(var i= 0;i<ID.length;i++){

        returnArray.push("sap.ui.getCore().byId"+'('+'"'+ID[i]+'"'+')');

}

    return returnArray;

}

 

 

var x=getById(["miRequestDateDatePicker","miApprovalDateDatePicker"]);

       

 

 

        for(var i=0;i< x.length;i++){

            x[i]=x[i].concat(".setEditable"+'('+mode+')'+';');

            console.log(x[i]);

            //eval(x[i]);

            

        };

 

my array elements looks like this

x[0]="sap.ui.getCore().byId("miRequestDateDatePicker").setEditable(true);" i need to run this code in place of //eval(x[i]),

 

please suggest me a solution other than eval();

 

regards

Ajaay


Viewing all articles
Browse latest Browse all 6412

Trending Articles