$('input.editor-active', row).prop( 'checked' ???
$('input.editor-active', row).prop( 'checked' ???
Hi.
I have a table as a variable "kalenderwoche". That also works so far
var kalenderwoche = moment().isoWeek();
kalenderwoche = 'kw'+fill(kalenderwoche);
....................
columns: [
{
data: null,
defaultContent: '',
className: 'select-checkbox',
orderable: false
},
{ data: kalenderwoche+".Klasse"},
{ data: kalenderwoche+".KNachname"},
but unfortunately this doesn't work. What am I doing wrong?
rowCallback: function ( row, data ) {
$('input.editor-active1', row).prop( 'checked', data.kalenderwoche +'.Mo_mitessen' == 1 );
$('input.editor-active2', row).prop( 'checked', data.kalenderwoche +".Mo_haus" == 1 );
}
...............
but this works
$('input.editor-active1', row).prop( 'checked', data.kw07.Mo_mitessen == 1 );
$('input.editor-active1', row).prop( 'checked', data.kw07.Mo_haus == 1 );
kw07 is value for "kalenderwoche"
Can somebody tell me why?
Thanks Christian
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
This question has an accepted answers - jump to answer
Answers
This is telling Javascript to look use the key
kalenderwoche.Mo_mitessen
. It is not referencing the variable. Trydata[kalenderwoche +'.Mo_mitessen']
instead. For example:rowCallback: function ( row, data ) {
```
Kevin
Thanks for the quick reply but unfortunately it doesn't work that way either
Thanks for the quick reply but unfortunately it doesn't work that way either
You probably need to use:
If that doesn't work, can you show your JSON that is being loaded for the table please?
Allan
Thank you very much Allan it worked. Greetings