jqgrid:"选择全部"的工具提示复选框

时间:2017-03-09 07:44:18

标签: jqgrid

我是jqgrid的新手。我需要显示一个工具提示" Select All"列标题中的复选框,以便当用户将鼠标悬停在"选择全部"上时,工具提示会显示复选框。请帮忙。以下是生成网格的代码。

jQuery("#ListContacts").jqGrid({
    data: jqgrid_data,
    datatype: "local",
    height: '700',
    width:'700',
    colNames: ['ContactID', 'Contact Name', 'Cell', 'Office', 'Email', 'Address'],
    colModel: [
        { name: 'ContactID', index: 'ContactID', hidden: true },
        { name: 'ContactName', index: 'Contact Name', width: 120, cellattr: Soars.JQGridHelper.wrapContents },
        { name: 'Cell', index: 'Cell', align: "right", width: 400 },
        { name: 'Office', index: 'Office', align: "right", width: 40 },
        { name: 'Email', index: 'Email', align: "right", align: "center", width: 50 },
        { name: 'Address', index: 'Address',  width: 60, datefmt: 'm/d/y', formatter: Soars.JQGridHelper.dateFormat, unformat: Soars.JQGridHelper.dateUnFormat }],
    rowNum: 25,
    rowList: [25, 50, 75, 100],
    altRows: true,
    pager: '#pager_ListContacts',
    pagerpos: 'left',
    recordpos: 'right',
    sortname: 'ContactID',
    viewrecords: true,
    emptyrecords: "No records to view",
    sortorder: "asc",
    multiselect: true,
    multiselectWidth: 16,
    headertitles:true
});

1 个答案:

答案 0 :(得分:0)

You need just set the title attribute of the checkbox. The id of the chechbox is build based on the id of the grid, but with "cb_" prefix. If the id of the grid is "list", for example, then the code

$("#cb_list").attr("title", "Select All");

executed after the grid will created the tooltip.

相关问题