是否可以选择/单击jqgrid中的页脚行? [英] Is a Footer row in a jqgrid selectable/clickable?

查看:88
本文介绍了是否可以选择/单击jqgrid中的页脚行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个jqgrid,它具有主行和页脚行(已加载用户数据),然后是格式化程序,该格式化程序将单元格中的数据更改为可链接的.可以单击主体中的单元格,并且onCellSelect事件将捕获该单击.但是,单击页脚行中的数据似乎不会触发onCellSelect事件.如何在页脚行中捕获选择/单击事件?下面是jqgrid的脚本.

I have a jqgrid that has main rows and a footer row (with userdata loaded) and then a formatter that alters the data in the cells to be linkable. The cells in the main body can be clicked and the onCellSelect event will capture the click. However, clicking on data in the footer row does not seem to fire off the onCellSelect event. How do I capture a select/click event in the footer row? Below is the script for the jqgrid.

$('#jqgSummaryResults').jqGrid({
        datatype: 'json',
        mtype: 'GET',
        url: 'some action',
        postData: { 'criteria': function () {
           some function}},
        rowNum: 100,
        rowList: [],
        pager: '#jqgpSummaryResults',
        viewrecords: true,
        sortorder: 'asc',
        sortname: 'DateField',
        width: 1250,
        height: 350,
        shrinkToFit: true,
        gridview: true,
        footerrow: true,
        userDataOnFooter: true,
        onCellSelect: function (rowid, iCol, cellcontent, e) {
            var selectedDate = rowid;
            savedMailDueDateString = rowid;
            var selectedColumn = iCol;
            ...
        },
        loadComplete: function (data) {
            ...
        },
        colNames: ['DateField',
                    'Total Jobs',
                    ...
                    '% Not Mailed'],
        colModel: [
                    { name: 'DateField', index: 'DateField', align: 'left' },
                    { name: 'TotalJobs', index: 'TotalJobs', align: 'left', formatter: hyperlinkColumnFormatter },
                    ...
                    { name: 'PercentNotMailed', index: 'PercentNotMailed', align: 'left', formatter: hyperlinkColumnFormatter },
                    ]
    }).navGrid('#jqgpSummaryResults', {
        excel: false,
        edit: false,
        add: false,
        del: false,
        search: false,
        refresh: false
    });

感谢您的帮助.

推荐答案

虽然我没有看到任何让jqGrid响应选择(甚至似乎无法选择页脚)或单击的方法.页脚行由ui-jqgrid-sdiv类指定.您可以按如下所示附加click事件处理程序.

While I didn't see any way to have jqGrid respond to select (doesn't even seem that that footer is selectable) or a click. The footer row is specified by a ui-jqgrid-sdiv class. You could attach a click event handler as below.

$('.ui-jqgrid-sdiv').click(function() {alert('Bong')});

响应吉尔·贝茨(Gill Bates)添加页脚事件的问题,但仅在单个单元格上,选择器将是:

In response to Gill Bates question to add a footer event but only on a single cell the selector would be:

$('.ui-jqgrid-sdiv').find('td[aria-describedby="GridName_ColumnName"]').click(function() { alert("Bong");});

GridName_ColumnName是所有页脚td aria所描述的格式,您可以通过Firebug元素检查器(或其任何等效项)查看确切的名称.

GridName_ColumnName is the format for all the footer td aria-describedby, and you can see the exact name via firebug element inspector (or any of it's equivalents).

这篇关于是否可以选择/单击jqgrid中的页脚行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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