I am using jquery-jtable plugin to display table. One of its field Notificaiton is getting JSON data then user can select e.g. group, pujan (users) to it. But when I save, JSON's id data is saved instead of name.

My question is how to save "name" instead of id?

    $('#TaskTableContainer').jtable({
        ....
        actions : {
            listAction : 'TaskController?action=list',
            createAction : 'TaskController?action=create',
            updateAction : 'TaskController?action=update',
            deleteAction : 'TaskController?action=delete'
        },
        ...
        notifyusers : {
            title : 'Notification',
            width : '10%',
            list: true,
            edit : false,
            create: true,
        },
        ...

enter image description here

有帮助吗?

解决方案

If someone is interested, I have achieved this through changing the JSON data. By default id value is saved into database.

Before

[{"name":"user1", "id":0},{"name":"user2", "id":1}...]

After

[{"name":"user1", "id":"user1"},{"name":"user2", "id":"user2"}...]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top