Sorry, I left it has a submit rather than a button. Below also makes sure that value is an array and the ng-init directive on the text fields sets initial values.
I use multiple gridEditors. And somehow there is trouble if i add 2 controllers to the same package manifest. So if i remove MyPlugin2.Controller.js, it all works as it should.
Well all I can suggest is that you add in the JS/HTML bit by bit to try to work out where the conflict is. You can add in as many JS files as you like, which don't need to be related to grid editors so start with a blank JS file I suggest.
Custom grid editor plugin. How to submit and clear a form.
Hello Everyone.
I am lost here. I am trying to make some custom Grid Editor Plugin... But i cant get the form to submit or clear it self.
What i wanna do is type in some text and then add it to the control.value and empty the form.
What i got is this.
@Using Umbraco version 7.5.2
Try:
Then it saves the whole page.
And if i try to predefine the textfields, it wont let me.
Sorry, I left it has a submit rather than a button. Below also makes sure that value is an array and the ng-init directive on the text fields sets initial values.
EDIT (for future reference):
ng-click="addOnClick
" should beng-click="addOnClick()"
Nothing happens when i press the button.
Sounds like it is just your ng-click that isn't working then try changing it to
ng-click="addOnClick()"
Your code works well :)
I found my issue..
I use multiple gridEditors. And somehow there is trouble if i add 2 controllers to the same package manifest. So if i remove MyPlugin2.Controller.js, it all works as it should.
Bonus question. Do you know how to add controllers to both plugins whitout issue?
I've added multiple controllers to the package manifest just like you have. I assume you don't have this in both JS files?
rather it should be:
I'm guessing it isn't as simple as that.
Should they be in the same file or just 2 seperate?
I got it in 2 seperatefiles like this.
Separate, as you have them, is how I have it but it shouldn't matter. The Umbraco built in controllers are all in the same file.
Do you get any kind of console error?
No. i dont get any console errors.
I got a console.log(media) that i removed in my UmbMediaPicker.Controller.js, and that is not gettin updated either.
Well all I can suggest is that you add in the JS/HTML bit by bit to try to work out where the conflict is. You can add in as many JS files as you like, which don't need to be related to grid editors so start with a blank JS file I suggest.
Thank you for your help.
I just outcommented the clientDependency in the web.config. That seemed to work.
Really? That's weird. My best guess is that there was something in your JS which was preventing minification.
No.. I was wrong again... I just have to outcomment/incomment something in the config file. So it restart. A line break is not enough...
But still no console error.
And nothing in /App_data/logs/ ?
is working on a reply...