Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Add Check box Column to jquery JTable?

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
            }
        }
    });
like image 467
Ali Sarshogh Avatar asked Sep 01 '13 15:09

Ali Sarshogh


1 Answers

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'
            },
like image 59
kmorris Avatar answered Oct 01 '22 05:10

kmorris