jquery jtable Checkbox is not showing in the list

隐身守侯 提交于 2019-12-12 16:13:30

问题


actually i want to display Checkbox in the list for Boolean values from database

OriginatingLocation: {
   title: 'Originating Location',
   width: '30%',
   list: true,
   type:checkbox,
   create: false,
   edit: false
},

回答1:


It seems like you dont want to add or edit the record then it is very easy. jTable damo page (PagingAndSorting demo) having display: function, You can see it here. Also you can find more about jTable ApiReference here.
Below code may help you

OriginatingLocation: {
    title: 'Originating Location',
    width: '30%',
    list: true,
    display: function (data) {
            if (data.record.OriginatingLocation == true)
            {
                return '<input type="checkbox" checked>';
            }
            else
            {
                return '<input type="checkbox">';
            }
    },
create: false,
edit: false
},

Here OriginatingLocation is Boolean field.



来源:https://stackoverflow.com/questions/27814335/jquery-jtable-checkbox-is-not-showing-in-the-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!