Serenity: adding Bootstrap Tooltip (data-toggle="tooltip") to forms' inline validation error

Created on 13 Oct 2016  路  5Comments  路  Source: serenity-is/Serenity

Is the html template for the little X icon (css class vx) beside the form field that displays the validation error updatable? if so, where? (short of building my own Serenity dll)

I want to take advantage of Bootstrap's tooltip (http://www.w3schools.com/bootstrap/bootstrap_tooltip.asp) which is triggered by adding the data-toggle="tooltip" property to the html element.

I have tried adding the property via browser's dev tools, and it works perfectly (i.e. upon hover, instead of the plain title, it displays the bootstrap tooltip), which means it's just _begging_ to be added to Serenity. =)

Most helpful comment

@john20xdoe
I would like to see an example of how you did your tooltips - perhaps a wiki page here ?

All 5 comments

is there a way to use @Serenity.Decorators.addAttribute() to add this data-toggle attribute to a form .caption or <label>?

Can anyone show me how it's done? My target would be to be able to set it as a custom attribute, like the way [Hint] works.

Override dialogOpen, or in constructor, $('.vx').attr('data-toggle', ...)

is there a way to make it into an attribute like [BootStrapHint("Hello World")], to be used in forms.?

I adapted it similar to [StaticTextBlock] custom editor, but now it conflicts with [BooleanEditor] : Compile Error says "multiple custom types"...probably because it is another widget.

I guess my purpose is how to inherit it to ALL forms in my project (standardize?), not just in constructor of one. ?

Define a custom base class and derive from that.

@john20xdoe
I would like to see an example of how you did your tooltips - perhaps a wiki page here ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AmuthaKondusamy picture AmuthaKondusamy  路  3Comments

StefanTheiner picture StefanTheiner  路  3Comments

newyearsoft picture newyearsoft  路  3Comments

kilroyFR picture kilroyFR  路  3Comments

Akarsh03 picture Akarsh03  路  3Comments