我已经实现了
jquery的jtable.我想在行单击上执行一些操作,并且还想放置单独的图像,并且还想在该图像上添加我自己的单击事件.
我还想将该行的id传递给该自定义事件.
如何将其添加到jquery表?
我尝试了一些东西.
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>'; } } }
谢谢.