Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more renderers #2

Closed
plwalters opened this issue May 2, 2016 · 12 comments
Closed

Add more renderers #2

plwalters opened this issue May 2, 2016 · 12 comments

Comments

@plwalters
Copy link
Contributor

Add more renderers to cover bootstrap scenarios such as a custom attribute to crawl the DOM and locate all properties that are being validated and show errors if needed.

Also would be nice to have renderers for other style frameworks as well.

@brandonseydel
Copy link
Member

Are you thinking about something where you just provide the class to add to parent / self / sibling and provide a different selector for each? (cover all frameworks) What about appending * or span to a specified selector if field is required as an option. e.g. First Name -> First Name*

@Einarsson
Copy link

I'll gladely add some nice renderers, however currently it isn't possible to configure the plugin in regards to what renderer to use.

Love this new lib btw.

@brandonseydel
Copy link
Member

@Einarsson You will need to add that functionality in which would be part of the enhancement.

@plwalters
Copy link
Contributor Author

We plan to get this in before this coming Tuesday so if anyone wants to take a stab I can give some guidance

@brandonseydel
Copy link
Member

@PWKad Can you comment on my approach vs multiple renderers (which still could be done) Also you are wanting to display an aggregation of data errors by configuration?

@32graham
Copy link

32graham commented May 6, 2016

@PWKad I'm interested in creating a ValidationRenderer for the Polymer Paper Elements.

I just got it working for paper-input by changing the existing validation-renderer.js file in my jspm_packages directory. Obviously this is not where I need to be coding though 😄

Is there any guidance on where to put community written ValidationRenderer's? Will each community renderer be it's own package? Will the community build one package that exports many different renderers? Something else?

polymer-renderer

@plwalters
Copy link
Contributor Author

@brandonseydel We want to have the renderer pulled in using DI from the container. This will allow using different renderers all over the place. Hope to get this in place (pulling renderer from container) ASAP.

@32graham we plan to have a few renderers available by default although we aren't sure exactly how to structure it just yet. I appreciate the help with getting the paper one in place and I'll be sure to ping back here with a more long-term approach ASAP.

@plwalters
Copy link
Contributor Author

@brandonseydel @32graham how does this look -

main.js

import {CustomRenderer} from './custom-renderer';

export function configure(aurelia) {
  aurelia.use
    .standardConfiguration()
    .developmentLogging()
    .plugin('aurelia-validatejs', config => {
      config.setRenderer(CustomRenderer);
    });

  aurelia.start().then(a => {
    a.setRoot('app');
  });
}

for setting up a renderer globally?

You can also set it up on a per-component basis but I'm still thinking of the best way of handling this.

@Einarsson
Copy link

Looks good @PWKad

plwalters added a commit that referenced this issue May 21, 2016
Fixes #2.  This allows the developer to configure a new renderer to use
globally.  Next step is to show recommendation for how to do this at
each component as well.
@plwalters
Copy link
Contributor Author

@Einarsson cool thanks for the feedback I've just created a branch with those changes in it if everyone likes that for now I'll merge shortly

@32graham
Copy link

32graham commented May 21, 2016

@PWKad As far as setting a global renderer goes this seems great.

@forestmarie
Copy link

@PWKad I second that approach for setting the global renderer.

@jdanyow jdanyow closed this as completed Jul 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants