У меня проблема с вставкой данных JSON в таблицу DataTable.
Вот пример данных json, отправленных сервером:
{"geneItemList":"{"col":"symbol","qv":"cd4","limit":"-1","start":"0","geneid":"920","name":"CD4"
,"symbol":"CD4","lastupdated":"2009-05-20 10:01:52.0","lastmodified":"2009-05-20 11:12:37.0"}
,...
А вот мой код YUI:
<script type="text/javascript">
YAHOO.namespace("local");
var qct = YAHOO.local;
YAHOO.util.Event.addListener(window, "load", function() {
qct.RowSelection = function() {
var myColumnDefs = [
{key:"geneid", label:"Gene", formatter: "number", sortable:true},
{key:"name", label:"Name", sortable:true},
{key:"symbol", label:"Symbol", sortable:true},
{key:"lastupdated", label:"Last Updated", formatter:"date", sortable:true},
{key:"lastmodified", label:"Last Modified", formatter:"date", sortable:true}
];
var myDataSource = new YAHOO.util.DataSource("qct-list.html");
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
myDataSource.connXhrMode = "queueRequests";
myDataSource.responseSchema = {
resultsList: "geneItemList",
fields: [{key:"col", parser:"string"},
{key:"qv", parser:"string"},
{key:"limit", parser:"number"},
{key:"start", parser:"number"},
{key:"geneid", parser:"number"},
{key:"name", parser:"string"},
{key:"symbol", parser:"string"},
{key:"lastupdated", parser:"date"},
{key:"lastmodified", parser:"date"}]
};
// test this
var myGeneListTable = new YAHOO.widget.DataTable("geneListTable", myColumnDefs, myDataSource,
{initialRequest:"?col=<c:out value="${fieldName}"/>&qv=<c:out value="${queryValue}"/>&start=<c:out value="${start}"/>&limit=<c:out value="${limit}"/>", selectionMode:"single"});
etc...
Когда я тестирую свою страницу, у меня появляется «Ошибка данных». по моим данным!
Идея, что не так?