How Add Check box Column to jquery JTable?

Harry picture Harry · Sep 1, 2013 · Viewed 8.6k times · Source

I read Jtable references and saw samples , I want to add check box column to Jtable result and each of them have unique ID .

Have Jquery Jtable check box column by default ?

Or can every body tell me sample ? this is my code :

     $('#PersonTableContainer').jtable({
        title: 'Table of people',
        actions: {
            listAction: '/GettingStarted/PersonList',
            createAction: '/GettingStarted/CreatePerson',
            updateAction: '/GettingStarted/UpdatePerson',
            deleteAction: '/GettingStarted/DeletePerson'
        },
        fields: {
            PersonId: {
                key: true,
                list: false
            },
            Name: {
                title: 'Author Name',
                width: '40%'
            },
            Age: {
                title: 'Age',
                width: '20%'
            },
            RecordDate: {
                title: 'Record date',
                width: '30%',
                type: 'date',
                create: false,
                edit: false
            }
        }
    });

Answer

kmorris picture kmorris · Sep 1, 2013

Have you seen this page: SelectingRows

You add the checkbox field like this:

            RowCheckbox: {
                title: 'Status',
                width: '12%',
                type: 'checkbox',
                values: { 'false': 'Passive', 'true': 'Active' },
                defaultValue: 'true'
            },