We tried to use syncfusion and font-awesome icons inside the same command column, is it possible?
Based on your query, you want to add both Syncfusion icons and Front awesome icons in the same command column. Your requirement can be achieved using the custom command items in which you can set the icons of Syncfusion and FontAwesome as you wish using the `buttonOpetion.iconCss` property.
Please refer the below code example:
|
commands: [ { type: "Delete", buttonOption: { cssClass: "e-flat", iconCss: "e-delete e-icons" }, }, { type: "Edit", buttonOption: { cssClass: "e-flat", iconCss: "fa fa-edit" }, }, { buttonOption: { cssClass: "e-flat", iconCss: "fa fa-info-circle" } }, ],
|
Sample: https://codesandbox.io/s/242946-vue-timepicker-modified-timepikcer-forked-4tm5pz?file=/src/App.vue
Please add the below link in the index.html file and you can add the icon to the Grid as you want
|
<link rel="stylesheet" rel='nofollow' href=https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css />
|
Please get back to us for further details.
Hi, Joseph, your example showing the desired result but not clear how you imported the CSS into the Vue project?, I am not seeing it in the App.Vue or main.js or HelloWorld.vue.
In my project's Vue page, I tried to import the CSS, the shopping cart button is NOT showing up inside the Grid after I added:
Thanks
After I added the fontawesome.css locally into assets folder in our source code. following is what displaying:
We also have following code in our Main.JS:
As we have mentioned in the previous update you should add the online link to import the font awesome icons which we have shared in the same update in head section of the index.html file. Please refer the below screenshot.
Screenshot:
Please get back to us for further details.
Hi, Joseph:
There seems to be two ways of importing the fontawesome icons:
import { library } from '@fortawesome/fontawesome-svg-core';
import {
faSignInAlt, faSignOutAlt, faShoppingCart, faUserAlt, faUserEdit,
} from '@fortawesome/free-solid-svg-icons';
import { faProductHunt } from '@fortawesome/free-brands-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
Could we just use the second method and get the fontawesome icons into the datagrid? Setting up fontawesome itself could be quite some effort, and doing both could also introduce conflicts, as there are different versions of fontawesome fonts....4,5,6,7 etc
Before proceeding to the solution we would like you to confirm the following.
The second method which you have suggested in you update is used to render the fontawesome icons as a separate vue component. If you want to use this method you cannot achieve your requirement using command columns, you should use the column template method to achieve your requirement. Is it ok for you to use the column template method?
Please get back to us for further details.
Thanks, Joseph, we found a work-around, so we are good for now, thanks for your inputs
Hi Wei,
Thanks for your update. We are glad that your issue has been resolved. Please get back to us for further details.
Regards,
Joseph I.