简体   繁体   中英

jqwidget grid cell formatting of json data

I'm trying jqwidget grid with json data inside a mvc project. Grid cell formatting for a date field is problem. The code below gets a cell like "/Date(1340204039263)/". How can I solve this?

$(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}]
});

});

您是否在初始化时尝试使用此{名称:'UyelikTarihi'},而不是{名称:'UyelikTarihi'},而是输入:'date'}?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM