aaData not working in jquery each statement
aaData not working in jquery each statement
nitinjambhale
Posts: 2Questions: 0Answers: 0
aaData not working in jquery each statement ..
My scenario:
i m calling service and my succedded function is :
function ServiceSucceeded(result) {
if (DataType == "json") {
//alert(result);
var obj = jQuery.parseJSON(result);
if (obj != null) {
$('#demo').html('');
$('#example').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sScrollY": "400px",
"aaData": [
jQuery.each(obj, function (key, value) {
if (key < 1)
{
[ "sda", "asd","weq","fgtre" ]
// here i m generating html controls as well.
}
}) // end of for each
],
//], // end of aaData
"aoColumns": [
{ "sTitle": '1', "sClass": "center", "sWidth": "15px" },
{ "sTitle": '2', "sClass": "center", "sWidth": "20px" },
{ "sTitle": '3', "sClass": "left", "sWidth": "250px" },
{ "sTitle": '4', "sClass": "left", "sWidth": "250px" }
] // end of aaColumns
});
when i run this [object Object] is showing in all columns.
Please help.
Regards,
Nitin Jambhale.
My scenario:
i m calling service and my succedded function is :
function ServiceSucceeded(result) {
if (DataType == "json") {
//alert(result);
var obj = jQuery.parseJSON(result);
if (obj != null) {
$('#demo').html('');
$('#example').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sScrollY": "400px",
"aaData": [
jQuery.each(obj, function (key, value) {
if (key < 1)
{
[ "sda", "asd","weq","fgtre" ]
// here i m generating html controls as well.
}
}) // end of for each
],
//], // end of aaData
"aoColumns": [
{ "sTitle": '1', "sClass": "center", "sWidth": "15px" },
{ "sTitle": '2', "sClass": "center", "sWidth": "20px" },
{ "sTitle": '3', "sClass": "left", "sWidth": "250px" },
{ "sTitle": '4', "sClass": "left", "sWidth": "250px" }
] // end of aaColumns
});
when i run this [object Object] is showing in all columns.
Please help.
Regards,
Nitin Jambhale.
This discussion has been closed.
Replies
Can u plz tell me how to create test cases, i m very new to this one.
I m maintaining all js and css in local folder so unable to use in fiddler.
Please advise.
CSS could be added to the HTML (inline), but I think it is not needed in your case.