c# - Umbraco Grid custom editor not persisting config to the Model -


i trying implement custom umbraco grid editor fixed width , height image. config in /config/grid.editors.config.js looks this:

[ {     "name": "image",     "alias": "media",     "view": "media",     "icon": "icon-picture" }, ... other default editors  {     "name": "fixed width image",     "alias": "fixedwidthimage",     "view": "media",     "icon": "icon-picture",     "config": {         "size": {             "width": 170,             "height": 300         }     } } ] 

with in place (see last grid editor: fixed width image), can select in grid. persists view. problem cannot config part. comes empty:

if (model.editor.config != null && model.editor.config.size != null) {     url += "?width=" + model.editor.config.size.width;     url += "&height=" + model.editor.config.size.height;      if (model.value.focalpoint != null)     {         url += "&center=" + model.value.focalpoint.top + "," + model.value.focalpoint.left;         url += "&mode=crop";     } } 

model.editor not null , shows correct custom editor added in config. model.editor.config {} when evaluating dynamic expression in visual studio.

additional information: did not else add editor in config depicted above custom editor working in umbraco.

thank guys in advance!

ok, fixed it.

it happened config added after added item editor grid.

so, in short, create config before editing grid.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -