dynamics events

I have this

$$(‘myView’).clearAll(); it’s works fine

now i have this :

var eventClearAll = function (myView){

	return "$$("+"'"+myView+"'"+").clearAll()"+";"; 
}

doesn’t work

i don’t understand at all

Hi,

it would be more correct to use the following:

var eventClearAll = function (viewId){
    $$(viewId).clearAll(); 
}
//function call
eventClearAll('myView');