Easygrid
Easygrid copied to clipboard
Unable to override autocompleteRenderer in 1.6.1
After upgrade to 1.6.1 I'm unable to override the default _autocompleteRenderer. I have extracted _autocompleteRender.gsp (btw, why this particular renderer is not installed during EasygridSetup?) from plugin, and put it in views/templates/easygrid (same directory as the rest of the renderers). I have also added the template option to EasygridConfig.groovy:
autocomplete {
idProp = 'id'
template = '/templates/easygrid/autocompleteRenderer'
}
But all of these seem to have no effect - I still have the default renderer view. I'm not sure if this template option is even used, it's not defined where i supposed it would be: https://github.com/tudor-malene/Easygrid/blob/master/src/groovy/org/grails/plugin/easygrid/AutocompleteConfig.groovy
I had this working in 1.4.2, but now in 1.6.1 I can't make it work again :(
Hi,
I will check this out. It's probably a bug.
Thanks, Tudor
Hi, I tried to overwrite the default renderer, and it works ok.
In your EasygridConfig.groovy file you should have something like this:
easygrid{
.....
defaults{
......
autocomplete {
template = '/templates/easygrid/myAutocompleteRenderer'
}
....
}
....
}
This template is not copied during the setup phase, because I considered that for most use cases, there's not much to modify in it. But it's very easy to use your own renderer, if you need specific behaviour.
Let me know if you got it working.
Thanks
Hi there,
I changed the name of the file and it helped. Still, if I change it back to the default name ('_autocompleteRenderer.gsp'), and set the 'template' option accordingly - it does not work. It seems that there is some kind of check that works like "If the filepath is default -> use bundled template"
Hi,
Yes, this is a little confusing. I plan to change this a little to make it more 'convention over configuration' in the next versions.
For now , you should use a different name.
Thanks