Hi,
I created custom grid module using ui component layout
In that i want to add new button near to filter button.
That new button should functions like action drop down function i.e capture all selected items in grid.
I tried to override following file in my admin module as above but its fails.
Magento\vendor\magento\module-ui\view\base\web\templates\grid\filters\filters.html
I used requirejs config file in following path
<Namespace>\<Module>\view\adminhtml\requirejs-config.js
my override filter file in
<Namespace>\<Module>\view\adminhtml\templates\grid\filters\filters.html
requirejs-config.js:
var config = { "map": { "*": { "Magento_Ui/templates/grid/filters/filters.html": "<Namespace>_<Module>/template/grid/filters/filters.html" } } };
I am using Magento 2.1 CE version.
Suggesstion pls.
Thanks.
Solved! Go to Solution.
You can try with below way,
create requirejs-config.js file inside base folder instead of adminhtml folder,
var config = { "map": { "*": { "Magento_Ui/templates/grid/filters/filters": "<Namespace>_<Module>/template/grid/filters/filters" } } };
Remove html from templates defination
Also create template folder in your module inside base directory not use adminhtml directory,
New Folder Path:
<Namespace>\<Module>\view\base\web\template\grid\filters\filters.html
Run command,
php bin/magento setup:upgrade php bin/magento setup:static-content:deploy
I have updated my answer.
if issue resolved, Click Kudos/Accept as solutions.
Thanks Its working as you suggest.
We need one small change in our requirejs-config.js in our base folder
Magento_Ui/templates is mapped to ui/template in Magento\vendor\magento\module-ui\view\base\requirejs-config.js
So we need to remap from Magento_Ui/templates/grid/filters/filters to ui/template/grid/filters/filters
You can try with below way,
create requirejs-config.js file inside base folder instead of adminhtml folder,
var config = { "map": { "*": { "Magento_Ui/templates/grid/filters/filters": "<Namespace>_<Module>/template/grid/filters/filters" } } };
Remove html from templates defination
Also create template folder in your module inside base directory not use adminhtml directory,
New Folder Path:
<Namespace>\<Module>\view\base\web\template\grid\filters\filters.html
Run command,
php bin/magento setup:upgrade php bin/magento setup:static-content:deploy
I have updated my answer.
if issue resolved, Click Kudos/Accept as solutions.
Hi,
i tried as u suggest but not working
My requirejs config file in following path
<Namespace>\<Module>\view\adminhtml\requirejs-config.js
is it correct?
Sorry my requirejs config file in following path
<Namespace>\<Module>\view\base\requirejs-config.js
But its not working.
Thanks Its working as you suggest.
We need one small change in our requirejs-config.js in our base folder
Magento_Ui/templates is mapped to ui/template in Magento\vendor\magento\module-ui\view\base\requirejs-config.js
So we need to remap from Magento_Ui/templates/grid/filters/filters to ui/template/grid/filters/filters
Hi Rakesh,
i successfully override base filter template filters.html file as you suggest
but i have found one issue that its override all grids in product catolog, customers, sales order etc.
i want to override file only for my module.
Thanks.
How to remap from Magento_Ui/templates/grid/filters/filters to ui/template/grid/filters/filters?
I encountered this issue for a similar file today (ui-select-optgroup.html) and fixed it using this similar code:
For anyone attempting this in 2.4+
1. (Please note the smallcase "ui/template")
create requirejs-config.js file inside base folder instead of adminhtml folder,
var config = { "map": { "*": { "ui/template/grid/filters/filters.html": "<Namespace>_<Module>/template/grid/filters/filters.html" } } };
2.
Create overriden file at <Namespace>_<Module>/view/base/web/template/grid/filters/filters.html
3. Flush cache, and if module not installed then run setup:upgrade, setup:di:compile and deploy static content