Requested unknown parameter '0' from the data source fro row 0
Requested unknown parameter '0' from the data source fro row 0
victoreadward
Posts: 7Questions: 0Answers: 0
Hi folks, I am newbie in datatables.
I am trying to bind this JSON:
[code]{"cores":[{"dataDir":"/SOLR/solr/cores/simm_empresa/data/","index":{"current":"true","hasDeletions":"false","lastModified":"Sun Sep 15 11:21:46 BRT 2013","maxDoc":"27008244","numDocs":"27008244","optimized":"true","version":"1379196363885"},"instanceDir":"/SOLR/solr/cores/simm_empresa/","name":"simm_empresa","startTime":"Tue Sep 17 13:56:22 BRT 2013","uptime":"11842551"}]}[/code]
However, my table does not render properly and I got this message. My html code is:
[code]
<!--
<>1379196363885
-->
Name Instance Dir Data Dir Start Time Uptime
Current Has Deletions Last Modified Max Doc Num Docs Optimized
Version
name instanceDir dataDir 1 1 Object
false false last modified 1 1 false
1
[/code]
My init code:
[code]$('#coresTable').dataTable({
'sDom': '<\'row\'<\'span6\'<\'dt_actions\'>l><\'span6\'f>r>t<\'row\'<\'span6\'i><\'span6\'p>>',
'sPaginationType': 'bootstrap_alt',
'bProcessing': true,
'bServerSide': true,
'sAjaxDataProp': 'cores',
'sAjaxSource': 'http://localhost:8080/solrmonitor/service/cores/list',
'oLanguage': {
"sLengthMenu": '_MENU_ lines per page'
}
});[/code]
Please, any idea, how could I to sove this issue?
Thanks in advance.
I am trying to bind this JSON:
[code]{"cores":[{"dataDir":"/SOLR/solr/cores/simm_empresa/data/","index":{"current":"true","hasDeletions":"false","lastModified":"Sun Sep 15 11:21:46 BRT 2013","maxDoc":"27008244","numDocs":"27008244","optimized":"true","version":"1379196363885"},"instanceDir":"/SOLR/solr/cores/simm_empresa/","name":"simm_empresa","startTime":"Tue Sep 17 13:56:22 BRT 2013","uptime":"11842551"}]}[/code]
However, my table does not render properly and I got this message. My html code is:
[code]
<!--
<>1379196363885
-->
Name Instance Dir Data Dir Start Time Uptime
Current Has Deletions Last Modified Max Doc Num Docs Optimized
Version
name instanceDir dataDir 1 1 Object
false false last modified 1 1 false
1
[/code]
My init code:
[code]$('#coresTable').dataTable({
'sDom': '<\'row\'<\'span6\'<\'dt_actions\'>l><\'span6\'f>r>t<\'row\'<\'span6\'i><\'span6\'p>>',
'sPaginationType': 'bootstrap_alt',
'bProcessing': true,
'bServerSide': true,
'sAjaxDataProp': 'cores',
'sAjaxSource': 'http://localhost:8080/solrmonitor/service/cores/list',
'oLanguage': {
"sLengthMenu": '_MENU_ lines per page'
}
});[/code]
Please, any idea, how could I to sove this issue?
Thanks in advance.
This discussion has been closed.
Replies
Also do you need table data in the dom if you are using ajaxsource?
Allan
[code]
$('#coresTable').dataTable({
'sDom': '<\'row\'<\'span6\'<\'dt_actions\'>l><\'span6\'f>r>t<\'row\'<\'span6\'i><\'span6\'p>>',
'sPaginationType': 'bootstrap_alt',
'bProcessing': true,
'bServerSide': true,
'sAjaxDataProp': 'cores',
'sAjaxSource': 'http://localhost:8080/solrmonitor/service/cores/list',
'aoColumns': [
{'mData': 'name'},
{'mData': 'instanceDir'},
{'mData': 'dataDir'},
{'mData': 'startTime'},
{'mData': 'uptime'},
{'mData': 'index.0'},
{'mData': 'index.1'},
{'mData': 'index.2'},
{'mData': 'index.3'},
{'mData': 'index.4'},
{'mData': 'index.5'},
{'mData': 'index.6'}
],
'oLanguage': {
"sLengthMenu": '_MENU_ linhas por página'
}
});
[/code]
And I also removed the html markup to the table data. The issue remains.
My table has 29 EMPTY rows. 29 is the result set size.
Notice that the item index at the JSON is an array. I tried to refer to it in mData like script above. Could it be the problem?
Allan
Thank you so much!
Allan