Open maysamsh opened 10 years ago
I had this problem also. The issue was: The table.header (
Hi @maysamsh
Can you try the following?
$('#my-ajax-table').dynatable({
dataset: {
ajax: true,
ajaxUrl: '/dynatable-ajax.json',
ajaxOnLoad: true,
records: []
}
});
This issue persists. Making changes to the REST Api that responds to dynatable requests is a bad idea. Can someone explain how to work around this?
This seems to be because the default column name translation is to camelcase. The problem arises when a record property key like "LargeLetters" in transformed to "largeLetters". When DynaTable tries to return the property/cell value it tries to get record[largeLetters] instead of record[LargeLetters].
This can be solved by creating a custom textTransform.
$.dynatableSetup({
table: {
defaultColumnIdStyle: 'noStyle'
}
});
// And on the table
$table.bind('dynatable:preinit', function(e, dynatable) {
dynatable.utility.textTransform.noStyle = function(text) {
return text;
};
})
I don't really get why this lib uses camelcase conversion by default.
Thanks @krokofant this corrected the issue I was having with data being returned via JSON and not matching camelcase.
I'm using such code to update my dynatable:
But when I log dynatable.records it says it's undefined.