dongtao1262 2015-01-21 12:49
浏览 122

jquery jtable中的分页显示1 2 3 NAN NAN 4

I'm trying to display 10 records per page but is hows the NAN values Below is the Code snippet

$('#JarDistHist').jtable('detach');
$('#JarDistHist').jtable({
            title: 'Jar Distribution History',
            paging: true,
            pageSize: 10,
            sorting: true,
            defaultSorting: 'Date ASC',
            actions: {
                listAction: 'StudentActions.php?action=list&DistId='+cname+'&fitem='+fitem+'',
                deleteAction: 'StudentActions.php?action=delete'
            },
            fields: {
                id: {

                    key: true,
                    create: false,
                    edit: false,
                    list: false,

                    },

                Date: {
                    title: ' Date',
                    type: 'date',
                     displayFormat: 'dd-mm-y',
                    width: '40%'


                },
                TotRecvJars: {
                    title: 'Rec. ',
                    width: '30%',
                    display: function (data) {
                     return $('<a href="JarFillingDetail.php?id=' + data.record.id + '">'+data.record.TotRecvJars+'</a>');

                     // return  $('<a href="JarFillingDetail.php?id=' + data.record.id + '">'+data.record.Date.format('DD-MM-YY')+');
                     }
                },
                NoOfJarsFill: {
                    title: 'Filled ',
                    width: '30%',
                    type:'integer',
                    display: function (data) {
                     return $('<a href="JarFillingDetail.php?id=' + data.record.id + '">'+data.record.NoOfJarsFill+'</a>');


                     }
                },

                BalanceJars: {
                    title: 'Bal. ',
                    width: '30%',
                    type:'integer',
                    display: function (data) {
                     return $('<a href="JarFillingDetail.php?id=' + data.record.id + '">'+data.record.BalanceJars+'</a>');


                     }
                }

            }
        });

        //Load person list from server
        $('#JarDistHist').jtable('load');
  • 写回答

1条回答 默认 最新

  • doulun1666 2015-01-21 12:54
    关注

    In your column definitions you are saying type: 'integer' (NoOfJarsFill and BalanceJars), which means you want to display a number. But then you are returning HTML content as the value, which is not a number. "Not A Number" is exactly what NAN stands for.

    Change type: 'integer' to type: 'string' and your problem will be solved.

    评论

报告相同问题?

悬赏问题

  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入