Easygrid icon indicating copy to clipboard operation
Easygrid copied to clipboard

Unable to override autocompleteRenderer in 1.6.1

Open kars7e opened this issue 10 years ago • 4 comments

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 :(

kars7e avatar May 23 '14 15:05 kars7e

Hi,

I will check this out. It's probably a bug.

Thanks, Tudor

tudor-malene avatar May 24 '14 10:05 tudor-malene

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

tudor-malene avatar May 26 '14 11:05 tudor-malene

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"

kars7e avatar May 27 '14 15:05 kars7e

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

tudor-malene avatar May 28 '14 20:05 tudor-malene