Jquery jtable checkbox not showing in list

Actually, I want to display a checkbox in a list for boolean values ​​from the database

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

      

+3


source to share


1 answer


It seems like you don't want to add or edit a post, then it's very simple. jTable damo page (PagingAndSorting demo) with function display:

, you can see it here . Also here you can find more details about jTable ApiReference .
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
},

      



 The BooleanOriginatingLocation

field is located here .

+5


source







All Articles