Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82273

aoColumns works aoColumnsDefs doesn't, can't understand why

$
0
0
Since now i just used aoColumns to bind the colums from the records i extract from a db to the colums in the table.
I tried to switch to aoColumnDefs and it's making me literally going crazy because i don't get where i'm doing wrong.
Please help me, i've read all about this isse i could red, but i'm stuck and really frustrated.

Debugger results: http://debug.datatables.net/uyikoz

The aoColumnsDefs in my code:
i tried replacing mData with mDataProp. Even tried to replace columns identifiers with indexes (ex: "mData": "0" ), but no way.
		"aoColumnsDefs": [
			{ "mData": "engine"
			, "target": [0]
				} ,
				
			{ "mData": "browser"
			, "target": [1]
				} ,
				
			{ "mData": "platform"
			, "target": [2]
					} ,
					
			{ "mData": "version"
			, "target": [3] 
				} ,
			
			{ "mData": "grade"
			, "target": [4]
	 	 	, "bSortable": false 
			, "bSearchable": false
				}  
			
		] ,
 
if i replace the above code with this one with aoColumns it works again
		"aoColumns": [
			{ "mData": "engine"	} ,
			{ "mData": "browser"	 } ,
			{ "mData": "platform" } ,
			{ "mData": "version"	} ,
			{ "mData": "grade", "bSearchable": false }  ,
		] ,
 
Raw json i feed datatables with:
{
  "sEcho": 1,
  "iTotalRecords": "57",
  "iTotalDisplayRecords": "57",
  "aaData": [
    {
      "engine": "Gecko",
      "browser": "Firefox 1.0",
      "platform": "Win 98+ / OSX.2+",
      "version": "1.7",
      "grade": "A",
      "DT_RowClass": ""
    },
...
... ,
    {
      "engine": "Gecko",
      "browser": "Firefox 1.5",
      "platform": "Win 98+ / OSX.2+",
      "version": "1.8",
      "grade": "A",
      "DT_RowClass": ""
    }
  ]
}
 

Viewing all articles
Browse latest Browse all 82273

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>