Skip to content
This repository has been archived by the owner on Jan 11, 2018. It is now read-only.

Support InputFor inside InputGroup #59

Closed
RemarkLima opened this issue Jun 15, 2016 · 12 comments
Closed

Support InputFor inside InputGroup #59

RemarkLima opened this issue Jun 15, 2016 · 12 comments

Comments

@RemarkLima
Copy link

Is it possible for InputGroups to support EditorFor and InputForm elements.

Or if the EditorFor can also have a InputGroupAddon()

@daveaglick
Copy link
Owner

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.

@RemarkLima
Copy link
Author

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 divs for bootstrap and use the standard @Html.TextboxFor templates.

@daveaglick
Copy link
Owner

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.

@daveaglick daveaglick changed the title Input Groups to support EditorFor / InputFor Support InputFor inside InputGroup Jun 15, 2016
@RemarkLima
Copy link
Author

Fantastic, I'll fork and see if I can make any headway into it as well.

@dbuenor
Copy link

dbuenor commented Sep 16, 2016

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.

@daveaglick
Copy link
Owner

Resolved by #64

@daveaglick
Copy link
Owner

I'll try and remember to do a release next week - feel free to ping me if I forget.

@dbuenor
Copy link

dbuenor commented Sep 19, 2016

Great. Thx for your work.

@dbuenor
Copy link

dbuenor commented Sep 22, 2016

Hi @daveaglick , dont forget to do a release plz! :)

@dbuenor
Copy link

dbuenor commented Sep 27, 2016

@daveaglick any news about the release? Thx.

@daveaglick
Copy link
Owner

Sorry for the delay, got busy - 3.3.5.4 is now out

@dbuenor
Copy link

dbuenor commented Sep 28, 2016

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
#59 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APW7QaSDHhDXBaMYMWy055Z7v6zYUXv-ks5quVqsgaJpZM4I2T14
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants