The symbols you are seing are placeholders for live binding and will disappear once you add the rendered document fragment to the DOM.
I recommend always using can.view
because it returns a document fragment instead of can.view.render
which returns a string (which is probably also why the data helper doesn't work because data can only be attached to DOM elements). Document fragments already are a DOM structure so there is no reason to run it through can.trim (in fact it converts it back to a string and trims that string, which is very likely not what you need).
Here is a fiddle example which also logs the widget data to the console: http://jsfiddle.net/3gD2p/
// widgets
var LayoutWidget = can.Model({}, {});
var widget = LayoutWidget.model({
id: 1,
name: 'Menu',
config: {
width: 4,
height: 1
}
});
$('#dummy').html(can.view('layout-widget-template', widget));
console.log($('.layout-widget').data('widget'));