Created a custom Grid Editor as per numerous tutorials on web.
Able to render content as normal on Grid layout.
but unable to insert pre set values within grid editor fields in Back Office to help content editors i.e textbox in back office to have pre value = 'type in this box'
not quite sure if i get you right, but if you want to show a placeholder i think you can add it to controller.config. this can be an object and there you add it as a string.
And then print it out with a placeholder attribute in your textarea.
For the advice, but my mistake on code i provided.
I have corrected the Editor.controller.js code, the line $scope.text2 = 'Please Type Here'; should populate the field in back office with the text.
An example is the built in Headline grid editor that has 'Write here' when you insert the editor into the layout.
I am new to Umbraco/Angluar & Razor, just working my way through examples when i hit an issue with my project.
Clearing cache fixed issue and able to to see pre values in text. Now issue is that once you save real content into textbox to overwrite pre values, the pre values are stilr rendered in back office and real content rendered on front end within Grid layout.
Custom Grid Editor issue
Dear Umbraco Team
Created a custom Grid Editor as per numerous tutorials on web. Able to render content as normal on Grid layout.
but unable to insert pre set values within grid editor fields in Back Office to help content editors i.e textbox in back office to have pre value = 'type in this box'
here is code from Grid Editor
Editor.html
Editor.controller.js
Editor.cshtml
Thanks Dibs
Hi Dibs,
not quite sure if i get you right, but if you want to show a placeholder i think you can add it to controller.config. this can be an object and there you add it as a string. And then print it out with a placeholder attribute in your textarea.
Regards David
Cheers David
For the advice, but my mistake on code i provided. I have corrected the Editor.controller.js code, the line
$scope.text2 = 'Please Type Here';
should populate the field in back office with the text.An example is the built in Headline grid editor that has 'Write here' when you insert the editor into the layout.
I am new to Umbraco/Angluar & Razor, just working my way through examples when i hit an issue with my project.
Thanks Dibs
Hi Dibs,
you have to store the value in $scope.control.value.text2 in your controller. That should work.
Regards David
Hi David
I have tried
$scope.control.value.text2
it didnet work : (Dibs
Hi David
Clearing cache fixed issue and able to to see pre values in text. Now issue is that once you save real content into textbox to overwrite pre values, the pre values are stilr rendered in back office and real content rendered on front end within Grid layout.
I think your right by using a placeholder.
Cheers Dibs
is working on a reply...