question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reference to fa-sync iso fa-refresh & Font-Awesome 4

See original GitHub issue

Bootstraptable version(s) affected

1.20.0

Description

Hello

I’m using bootstrap-table 1.20.0 with Font-Awesome 4.7.0 and noticed that the sync icon does not get displayed. The following piece of code seems to have no effect:

window.icons = {
  refresh: 'fa-refresh',
  toggle: 'fa-toggle-on',
  columns: 'fa-th-list',
  export: 'fa-download',
  search: 'fa-search',
  clearSearch: 'fa-trash'
  };

I defined my table using:

data-icons-prefix="fa" 
data-icons="icons" 
data-show-columns="true" 
data-show-refresh="true"
data-search="true"

All icons except refesh are displayed.

in bootstrap-table.js and bootstrap-table.min.js the refresh icon is referenced as fa-sync instead of fa-refresh. Somehow, the litte javascript from the documentation displayed above does not override fa-sync with fa-refresh.

Example(s)

<script type="text/javascript">
  // Fix for missing icons using bootstrap-tables.
  // Use in combination with the following directives: 
  // - data-icons-prefix="fas" 
  // - data-icons="icons" 
  window.icons = {
    refresh: 'fa-refresh',
    toggle: 'fa-toggle-on',
    columns: 'fa-th-list',
    export: 'fa-download',
    search: 'fa-search',
    clearSearch: 'fa-trash'
  };
</script>

<table class="table"
	data-toggle="table" 
	data-url="/api/query/get?table=catalog"
	data-toolbar="#toolbar"
	data-row-style="rowStyle"
	data-id-field="id" 
	data-pagination="true" 
	data-page-size="10"
	data-page-list="[10, 25, 50, 100, All]"  
	data-height="600"
	data-icons-prefix="fa" 
	data-icons="icons" 
	data-show-columns="true" 
	data-show-refresh="true"
	data-search="true"
	data-search-text=""
	data-multi-search=";"
	data-show-search-button="true"
	data-show-search-clear-button="true"
	data-response-handler="responseHandler"
	id="catalogTable">
	<thead>
		<tr>
			<th data-field="Key_Id" data-sortable="true" data-visible="false">Key</th>
			<th data-field="Id" data-sortable="true" data-visible="false">Id</th>
			<th data-field="Manufacturer" data-sortable="true">Vendor</th>
			<th data-field="Name" data-sortable="true" data-switchable="false">Product</th>
			<th data-field="Version" data-sortable="true">Version</th>
		</tr>
	</thead>
</table>

Possible Solutions

To solve this, I replaced the references to fa-sync to fa-refresh. This worked perfectly and does not break anything else as far as I know. Possibly, older Font-Awesome releases will not recognize fa-refresh.

sed -i 's/fa-sync/fa-refresh/' bootstrap-table.js sed -i ‘s/fa-sync/fa-refresh/’ bootstrap-table.min.js

Additional Context

https://github.com/wenzhixin/bootstrap-table/releases/tag/1.20.0 is deployed in my application.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
UtechtDustincommented, May 16, 2022

@Ka7ut0 you’re example has missing the style/link tag for fontawesome 4 (the editor uses fontawesome 5). If you add it, it works fine (check my example).

0reactions
UtechtDustincommented, May 17, 2022

No problem, you’re welcome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fa-refresh: Font Awesome Icons
Tons More. Ligatures for easier desktop use, shim for quick upgrades from 4, and more styles, icons, and tools with FA Pro.
Read more >
Font Awesome Intro - W3Schools
The fa-lg (33% increase), fa-2x , fa-3x , fa-4x , or fa-5x classes are used to increase the icon sizes relative to their...
Read more >
Updates to our asynchronous icon and font loader - Medium
Since then we've brought that same async loading to Fort Awesome but we didn't have any documentation or explain what was going on...
Read more >
Font Awesome not working, icons showing as squares
You must have 2 classes, the fa class and the class that identifies the desired icon fa-twitter , fa-search , etc …
Read more >
computer pun names
This cute list of funny cat puns includes pet puns for kittens, ... Nicknames, cool fonts, symbols and stylish names for Laptop –...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found