Using DataSchema is the correct way to handle this. I believe that the dotted key version used to work but then changes in version 3.5 stopped this working
YUI().use('datatable', 'datasource','datasource-jsonschema', function (Y) {
var ds = new Y.DataSource.Local({
source: [{
// broken
key: 'value',
'dot.notation': 5
}, {
// broken
key: 'value',
dot: {
notation: 5
}
}, {
// displays
key: 'value',
'dot.notation': 5,
dot: {
notation: 5
}
}]
});
ds.plug({fn: Y.Plugin.DataSourceJSONSchema, cfg: {
schema: {
resultFields: [
"key",
{
key:'foo',
locator:'dot.notation'
}
]
}
}});
var table = new Y.DataTable({
columns: ['key', 'foo'],
caption: 'Better Now'
});
table.plug(Y.Plugin.DataTableDataSource, {
datasource: ds
});
table.render('#lolol');
table.datasource.load();
});