I have problems with the checkbox options. I used this example https://editor.datatables.net/examples/advanced/joinArray.html to implement it. But i dedected problems two problems.
1.
in the example the editor would send a field data[0][permission-many-count]=2
. where does the field come from? In my implementation this field never comes in any cases.
2.
I have a server side script in java. I'm not sure to the send data format for the checkboxes is correct. No checkboxes are check, if the should checked. I append a part of the sending json file and the part in the editor. Anyone an idea whats wrong here in my code?
Andreas
here my code for the editor
usrForm = new $.fn.dataTable.Editor( {
table: '#usrtbl',
ajax: '/assets/php/api/users.php?usr=2',
display: 'bootstrap',
template: '#tplUser',
fields: [
{
label: frmInfo.u_role,
name: 'u_role',
data: 'role.id',
type: 'checkbox',
optionsPair: {
label: 'name',
value: 'id'
}
]
}
here my jsonformat that i send to the client
{
"content": [{
"DT_RowId": "a63bf953-f4a4-4927-b12b-011ee6eabba3",
"_index": 1,
"fullName": "BENIGNI Zita",
"lastname": "Benigni",
"firstname": "Zita",
"lastnamePrefix": "",
"birthday": "1974-03-05",
"gender": "FEMALE",
"nationality": {
"iso3166_1_alpha2": "AT",
"name": "Austria"
},
"email": "zita.benigni@chello.at",
"club": {
"uuid": "c4b1db94-31fd-4d5b-b611-71175b0321a3",
"name": "Vienna Dolphins"
},
"status": "APPROVED",
"uadress": {
"adress1": "",
"adress2": "",
"zip": "",
"state": "",
"country": {
"iso3166_1_alpha3": "",
"name": ""
},
"location": ""
},
"maxChildren": 0,
"language": "DE",
"role": {
"4": {
"id": 4,
"name": "Club"
},
"0": {
"id": 0,
"name": "User"
}
}
},.....
"recordsFiltered": 31,
"recordsTotal": 76,
"options": {
"u_role": [{
"name": "User",
"id": "0"
}, {
"name": "Parent",
"id": "1"
}, {
"name": "Athlete",
"id": "2"
}, {
"name": "Coach",
"id": "3"
}, {
"name": "Club",
"id": "4"
}, {
"name": "Federation",
"id": "5"
}, {
"name": "Administration",
"id": "6"
}]