Skip to navigation
How to popup a tooltip on a jqgrid table header cell
10.02.21
Example what calls an external API to get a tooltip explanation for an abbreviation requirements: bootstrap.bundle.min.js async function set_column_title() { const url = 'https://api.foo.net/abbreviation'; jQuery( ".ui-jqgrid-htable .ui-th-column div" ).each( async function( i ) { let id = this.id.split('jqgh_grid_'); if(id.length > 1) { let abbrev = id[1]; let term = abbrev; let r = JSON.parse(await aget_api(url +"?name="+abbrev)); // external source if(r['data']['term']) { term = r['data']['term']; } jQuery(this).attr("data-content",'
' + term + '
'); jQuery(this).popover({ 'trigger': 'hover', 'placement': 'top', 'html': true, 'delay': { "show": 0, "hide": 2000 } }); } }); }
https://getbootstrap.com/docs/4.0/components/popovers/
Reply
Anonymous
Information Epoch 1714164259
You can always add complexity.
Home
Notebook
Contact us