fix layeritem template if obj.Datasource is undefined