Sc_select doesn't work in Dashboard onScriptInit and onWidgetLoad

sc_select doesn’t work in Dashboard onScriptInit and onWidgetLoad

I copy the code from a Blank App to onScriptInit and I am getting this error, work fine in the Blank App

Php Code
image