1

jqgrid ページャーを使用して、グリッドの 1 つの追加リンクと更新リンクを表示しています。私はほとんどのグリッドで、追加、編集、削除、および更新にデフォルトのアイコンを使用する傾向があります。(バー) [追加]、[編集]、[削除] ボタンと更新ボタンの間。

私の「ゲーム」グリッドでは、カスタムの [追加] ボタン (更新前に表示されます) を使用していますが、更新ボタンの前にバーが表示されません。順序を並べ替えたり、navSeparatorAdd に位置オプションを追加したり、いろいろと調べたりしました。しかし、この状況で私を助けてくれたものは何も見つかりません。

Refresh をオフにしてカスタム ボタンを作成しようとしたことはありませんが、ハックのようです。追加後および更新前にそのバーを取得する方法についてのアイデアはありますか?

だから、私が持っているもの: + @ |

私が欲しいもの: + | @

(@ は更新アイコンのはずです)

ありがとう、エンバー

       jQuery("#Games").jqGrid('navGrid',
            '#GamesPager',
            {edit:false, add:false, del:false, search:false, 
             refreshtitle: "Refresh"},
            {}, //settings for edit
            {}, // settings for add
            {},  // settings for delete
            {} // advanced searching settings
        );
        jQuery("#Games").jqGrid('navButtonAdd',
            "#GamesPager",
            {   caption:"Add Game", 
                buttonicon:"ui-icon-plus", 
                onClickButton:function(){ 
                 loadAddColorBox();
               }, 
                position: "first", 
                title:"Add Game", 
                cursor: "pointer"
            } 
        );
        jQuery("#Games").jqGrid('navSeparatorAdd',
            "#GamesPager",
            {sepclass : 'ui-separator',sepcontent: ''}
        );
4

2 に答える 2

2

セパレーター

セパレーターを追加して、いくつかのアクションをグループ化することができます。これは、navSeparatorAdd メソッドを使用して実行できます。構文:

<script>
...
jQuery("#grid_id").navGrid("#pager",...).navButtonAdd("#pager",{parameters}).navSeparatorAdd("#pager",{separator_parameters}};
...
</script>

ここにドキュメントのリンクがあります
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_buttons

于 2013-06-16T12:39:22.050 に答える
0
        $(table_selector).jqGrid('navGrid', pager_selector, {
            cloneToTop: true,
            edit: false,
            add: false,
            del: false,
            search: false,
            refresh: true,
            view: false
        });

        $(table_selector).jqGrid('navSeparatorAdd', table_selector + '_toppager', {
            sepclass: 'ui-separator',
            sepcontent: '',
            position: 'first'
        });

        $(table_selector).jqGrid('navButtonAdd', table_selector + '_toppager', {
            caption: 'save',
            buttonicon: 'ui-icon ace-icon fa fa-pencil blue',
            onClickButton: function() {
                alert("1");
            },
            position: 'first'
        });
于 2014-05-20T06:54:46.540 に答える