我在mvc项目中尝试使用json数据的jqwidget网格。日期字段的网格单元格格式是有问题的。下面的代码得到一个像“/ Date(1340204039263)/”这样的单元格。我该如何解决这个问题?
$(document).ready(function () {
// prepare the data
var source = {
datatype: "json",
datafields: [{ name: 'PersonelId' }, { name: 'Ad' }, { name: 'DogumYili' }, { name: 'UyelikTarihi'}],
url: 'BindBasicGrid'
};
//var dataAdapter = new $.jqx.dataAdapter(source);
var dataAdapter = new $.jqx.dataAdapter(source, {
downloadComplete: function (data, status, xhr) { alert(JSON.stringify(data)); },
loadComplete: function (data) { },
loadError: function (xhr, status, error) { alert(JSON.stringify(xhr)); }
});
$("#jqxgrid").jqxGrid({
source: dataAdapter,
theme: 'classic',
columns: [{ text: 'Ad', datafield: 'Ad', width: 250 },
{ text: 'Doğum Yılı', datafield: 'DogumYili', width: 150 },
{ text: 'Üyelik Tarihi', datafield: 'UyelikTarihi', cellsformat: 'D', width: 180}]
});
});
答案 0 :(得分:0)
您是否尝试在初始化时使用此{name:'UyelikTarihi',输入:'date'}而不是{name:'UyelikTarihi'}?