Closed RemarkLima closed 7 years ago
EditorFor()
is interesting. What it actually does is goes and asks ASP.NET MVC for the rendered HTML that cooresponds to the editor template for the given model property type. ASP.NET MVC comes with some default templates, but it's entirely possible to swap those out for your own templates. When we call EditorFor()
, FluentBootstrap is just getting back the chunk of HTML that ASP.NET MVC gives it. FluentBootstrap doesn't try to further process it because the rendered template could be anything.
So back to the question of how to use an InputGroupAddon()
within EditorFor()
... The trick is to put your InputGroupAddon()
inside a custom editor template. That way, when you call EditorFor()
, the template will generate HTML that includes whatever other markup you want such as the addon. Since editor templates are themselves just Razor code, you can use FluentBootstrap from your template just like you do from your normal views.
I guess EditorFor
is a bit more a complex type given it can do everything / anything.
However, I still think InputFor
would be useful within an InputGroup
as this then wires up the model, the Id, values and validation without having to either add it to a plain Input
with magic strings, or writing your own EditorFor
editor template which is just a textbox with something added on.
For now, it's easier to just write the whole block of div
s for bootstrap and use the standard @Html.TextboxFor
templates.
That makes sense, and should be doable. Unlike EditorFor()
where FluentBootstrap wraps the output from MVC, InputFor()
and related extensions are generated directly by FluentBootstrap to look like their MVC counterparts. I'll log this as a feature enhancement.
Fantastic, I'll fork and see if I can make any headway into it as well.
Hi, im interested on this issue, so I' ve forked the repo and i'm going to make a pull request....i'm not sure if this the right way to do it because it's my first pullrequest on an external library. ^_^U
Hope u can check and merge if u think that is right.
Thank u so much.
Resolved by #64
I'll try and remember to do a release next week - feel free to ping me if I forget.
Great. Thx for your work.
Hi @daveaglick , dont forget to do a release plz! :)
@daveaglick any news about the release? Thx.
Sorry for the delay, got busy - 3.3.5.4 is now out
Np, thx for releasing the new version. :)
_David Bueno Rincón_www.evicertia.com| david@evicertia.es Lagasca 95 - 28006 Madrid Tel: +34 91 423 70 80
2016-09-27 20:04 GMT+02:00 Dave Glick notifications@github.com:
Sorry for the delay, got busy - 3.3.5.4 is now out
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/daveaglick/FluentBootstrap/issues/59#issuecomment-249947274, or mute the thread https://github.com/notifications/unsubscribe-auth/APW7QaSDHhDXBaMYMWy055Z7v6zYUXv-ks5quVqsgaJpZM4I2T14 .
Is it possible for InputGroups to support EditorFor and InputForm elements.
Or if the EditorFor can also have a InputGroupAddon()