在Jquery中的字段末尾添加自定义按钮 - jTable创建/更新模式,如提交按钮 [英] Add Custom button at end of fields in Jquery - jTable Create/Update mode like submit button

查看:181
本文介绍了在Jquery中的字段末尾添加自定义按钮 - jTable创建/更新模式,如提交按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在jquery-jTable,我们可以有一些领域和行动。我需要其他按钮[可能在页面末尾]附近的Jquery JTable按钮(提交按钮),在点击之后,运行另一个功能。所以
这是我的代码:

At jquery- jTable we can have some fields and actions . I need Other button [possible at end of page] near by Jquery JTable button("Submit" button) that after on Click , run another function . so this is my code :

    $('#RequestSubmitDiv').jtable({
            title: 'newRec',
            paging: false,
            sorting: false,
            selecting:false; 
            selectingCheckBoxes:false,
            selectOnRowClick:false,
            jqueryuitheme:true,
            formCreated:function(event,data){
                 data.form.validationEngine();
            },
            formSubmitting:function(event,data){
               ...
               ...
            },
            formClode: function(d,e){...} ,                

            actions: {
                createAction: '/Adminsec/ManageAssets.aspx/CreateOrUpdate',
           //---not need below
                //listAction: '/Adminsec/ManageAssets.aspx/List',
                //updateAction: '/Adminsec/ManageAssets.aspx/CreateOrUpdate',
                //deleteAction: '/Adminsec/ManageAssets.aspx/Deletes'

  //-!!---Other Button and Action Need ---!!
                CustomAction:{
                  title:'RefreshNew',
                  sorting:false,
                  create:false,
                  edit:false ,
                  list:false ,
                  display:function(data){
                    return '<input type='button' id='MyBtn' onclick='Call_Mehod();>';                              
                   }

                 }
            },

            fields: {
              ID {title:'pk',type:'textarea'} , 
              RequestNO{type:'textarea'},
              description{type:'textarea'}
            }
        });

如何在Jquery-Jtable和调用函数中添加一些按钮?
这些按钮不会在行或列重复,我的意思是它应该是字段范围之后的一个实例。

How can i add some button to Jquery- Jtable and call function ? these buttons don't repeat at rows or column , i mean it should be One instance after fields scope.

推荐答案

也许我误解了但是如果你想在每一行上添加一个按钮,你可以使用 显示该字段的属性。我创建了一个虚拟字段并添加了display属性。这样的事情:

Maybe I misunderstood but if you want to add a button on each row, you can use display property of the field. I created a dummy field and added the display property. Somthing like this:

...
Other: {
    title: 'Other',
    display: function (data) {
       return '<b>test</b>';
    },
    create: false,
    edit: false

}
...

但是,如果你想添加一般功能(即表格的单个按钮),你可以看一下 toolbar property

However, if you wanted to add a general feature (i.e. single button for the table) , you can take a look at the toolbar property.

这篇关于在Jquery中的字段末尾添加自定义按钮 - jTable创建/更新模式,如提交按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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