显示bootstrap图标以及jqgrid标题文本

时间:2015-05-11 23:34:01

标签: javascript jquery css twitter-bootstrap jqgrid

我正在尝试在jqgrid标题部分显示twitter bootstrap图标,但是图标没有显示。这是小提琴手:https://jsfiddle.net/99x50s2s/31/

Code Tried:

jQuery("#sg1").jqGrid({
    datatype: "local",
    gridview: true,
    loadonce: true,
    shrinkToFit: false,
    autoencode: true,
    height: 'auto',
    viewrecords: true,
    sortorder: "desc",
    scrollrows: true,
    loadui: 'disable',
    colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
    colModel:[
        {name:'id',index:'id', width:60, sorttype:"int"},
        {name:'invdate',index:'invdate', width:90, sorttype:"date"},
        {name:'name',index:'name', width:100},
        {name:'amount',index:'amount', width:80, align:"right",sorttype:"float"},
        {name:'tax',index:'tax', width:80, align:"right",sorttype:"float"},     
        {name:'total',index:'total', width:80,align:"right",sorttype:"float"},      
        {name:'note',index:'note', width:150, sortable:false}       
    ],
    caption: "<i class'glyphicon glyphicon-alert'></i> Pending"
});

当前输出:

enter image description here

预期:

enter image description here

我错过了什么吗?是否可以在jqgrid标题中显示bootstrap图标?请建议。

1 个答案:

答案 0 :(得分:1)

这是一个错字。您错过了=

 caption: "<i class'glyphicon glyphicon-alert'></i> Pending"

应该是:

 caption: "<i class='glyphicon glyphicon-alert'></i> Pending"

https://jsfiddle.net/99x50s2s/33/