Agregar datos a JSONObject
Estoy tratando de averiguar cómo agregar los siguientes datos a mi objeto json. ¿Podría alguien mostrarme cómo hacer esto?
Ejemplo de sitio web
$(document).ready(function() {
$('#example').dataTable( {
"aoColumnDefs": [
{ "aDataSort": [ 0, 1 ], "aTargets": [ 0 ] },
{ "aDataSort": [ 1, 0 ], "aTargets": [ 1 ] },
{ "aDataSort": [ 2, 3, 4 ], "aTargets": [ 2 ] }
]
} );
} );
Mi JSONObject que necesita incorporar el ejemplo anterior.
JSONObject json = new JSONObject();
json.put("aoColumnDefs", );