JQgrid设置ondblclick导航到新页面?

时间:2014-01-27 16:30:53

标签: javascript jquery html jqgrid

我有一个非常简单的jQgrid我用于网站

            <div id="catalogueSearchList" class="dataGrid">
                <script type="text/javascript">
                    var catalogueSearchListConfig = {
                        id: 'catalogueSearchList',
                        action: 'List',
                        controller: 'Catalogue',
                        //href: '/Jobs/Adverts/',
                        onDblClick: function (id) { HERE!!! }) },
                        colNames: ['Name', 'CatalogueType'],
                        colModel: [
                                    { name: 'Name', index: 'Name', width: 400, align: 'left' },
                                    { name: 'Catalogue type', index: 'CatalogueType', width: 175, align: 'left' },
                        ],
                        sortName: 'Name',
                        sortOrder: 'asc'
                    };
                </script>
            </div>

显示“HERE !!!”当观众双击jqgrid中的值时,我可以放在这里允许它将它们导航到另一个页面?

1 个答案:

答案 0 :(得分:0)

没关系,答案是

<div id="catalogueSearchList" class="dataGrid">
                <script type="text/javascript">
                    var catalogueSearchListConfig = {
                        id: 'catalogueSearchList',
                        action: 'List',
                        controller: 'Catalogue',
                        //href: '/Jobs/Adverts/',
                        onDblClick: function (id) { window.location.href = "/Catalogue/Category/" + id },
                        colNames: ['Name', 'CatalogueType'],
                        colModel: [
                                    { name: 'Name', index: 'Name', width: 400, align: 'left' },
                                    { name: 'Catalogue type', index: 'CatalogueType', width: 175, align: 'left' },
                        ],
                        sortName: 'Name',
                        sortOrder: 'asc'
                    };
                </script>
            </div>

使用javascript,您只需选择窗口并将其位置设置为您喜欢的位置:)