簡體   English   中英

jqgrid,按鈕以編輯形式填充值?

[英]jqgrid, button to fill a value in edit form?

我希望在其中一個輸入字段旁邊的jqgrid編輯表單中添加一個按鈕。 當我單擊按鈕時,我想在輸入字段中放置一個特定值。 我可以處理在字段中插入我想要的文本的代碼。 我不知道的部分是如何使自定義按鈕出現在文本字段旁邊。 查看我的草圖,按鈕。 然后我只需要有能力:

$('#my_new_button').click(...

在此輸入圖像描述

有誰知道如何在編輯表單中獲得此自定義按鈕?

謝謝!

是的,我覺得它可能,看到這個答案的家伙首先克隆了提交按鈕,然后更改了提交按鈕的屬性,然后將其添加到您想要的元素之后,在您的情況下,它應該在textBox之后總計(獲取ID )然后編寫關於你想要點擊的內容的功能......

http://www.trirand.com/blog/?page_id=393/help/add-your-own-custom-buttons-to-a-form-edit-dialog-page/

並且通過這個答案你也可以得到一些幫助,在這里他首先更改提交按鈕,然后再添加一個新的自定義按鈕......你可以從中獲取該功能..

如何向JqGrid添加/編輯表單添加自定義按鈕?

//Insert a link after #member_id into edit form

    $.extend($.jgrid.edit, {
        recreateForm: true,
        width:700,
        viewPagerButtons:false,
        beforeShowForm: function ($form) {
            $('CHECK ID')
                .click(function() {
                    alert("ID IS OK!");
                }).addClass("fm-button ui-state-default ui-corner-all fm-button-icon-left")
                  .insertAfter("#member_id");
        }
    });


//Insert a link after #member_id into add form

    $.extend($.jgrid.new, {
        recreateForm: true,
        width:700,
        viewPagerButtons:false,
        beforeShowForm: function ($form) {
            $('CHECK ID')
            .click(function() {
                alert("ID IS OK!");
            }).addClass("fm-button ui-state-default ui-corner-all fm-button-icon-left")
              .insertAfter("#member_id");
        }
    });

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM