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

时间:2022-09-04 08:39:23

I am trying to display twitter bootstrap icon in the jqgrid caption section but, the icon is not displaying. Here is the fiddler: https://jsfiddle.net/99x50s2s/31/

我试图在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"
});

Current Output:

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

Expected:

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

Am I missing anything? Is it possible to display bootstrap icon in jqgrid caption? Please suggest.

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

1 个解决方案

#1


It's a typo. You are missing the = :

这是一个错字。你错过了=:

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

should be:

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

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

#1


It's a typo. You are missing the = :

这是一个错字。你错过了=:

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

should be:

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

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