jQuery JTable自定义单击事件 [英] jquery jtable custom click event

查看:100
本文介绍了jQuery JTable自定义单击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了jquery的jtable.我想对行单击执行一些操作,还想放置单独的图像,还想在该图像上添加我自己的click事件.

I have implemented jtable of jquery. I want to perform some operation on row click and also want to put separate image and also want to add my own click event on that image.

我还想将该行的ID传递给该自定义事件.

I also want to pass that row's id to that custom event.

如何将其添加到jquery表中?

How can I add that to jquery table?

我尝试了一些东西.

LoadGrid = (function () {
            //Prepare jtable plugin
            $('#GridTableContainer').jtable({
                title: 'Assets',
                paging: true,
                pageSize: 10,
                sorting: true,
                defaultSorting: 'ModelName ASC',
                actions: {
                    listAction: '/Adminsec/ManageAssets.aspx/List',
                    createAction: '/Adminsec/ManageAssets.aspx/CreateOrUpdate',
                    updateAction: '/Adminsec/ManageAssets.aspx/CreateOrUpdate',
                    deleteAction: '/Adminsec/ManageAssets.aspx/Deletes'
                },
                updateRecord: (function() { alert("my custom action.");
                }),
.......

推荐答案

最后,完成.

CustomAction: {
    title: '',
    width: '1%',
    sorting: false,
    create: false,
    edit: false,
    list: true,
    display: function (data) {
        if (data.record) {
            return '<button title="Edit Record" class="jtable-command-button jtable-edit-command-button" onclick="alert(' + data.record.TicketId + '); return false;"><span>Edit Record</span></button>';
        }
    }
}

谢谢.

这篇关于jQuery JTable自定义单击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆