table redraw after Editor submit doesn't display correct data
table redraw after Editor submit doesn't display correct data
In my table I have the following column setup:
{ data: null, title: 'Ein/Aus', render: function ( data, type, row ){
var label;
switch( data.inex ){
case '1':
label = "Einnahme";
break;
case '2':
label = "Ausgabe";
break;
default:
label = "";
}
return label;
} },
After the Editor submits successfully and the table is redrawn, this label doesn't show up, only after reloading the page. The same goes for other colums I have a switch label in place (like 'Status' values and their labels). The value for the 'inex' field is definitely returned through the ajax function, but it seems the redraw only uses the default label. Do I need to change something?
This question has an accepted answers - jump to answer
Answers
Is
data.inex
definitely a string and not a number in the returned JSON? Could you show me the JSON that is being returned from the edit Ajax request?Thanks,
Allan
Thank you @allan that was the issue, the number was saved as int in the db, therefore it didn't return a string - I've now managed to treat is as an int all the way through.