asp.net mvc - ASP MVC with jQuery, how to approach inline editor design? -
i'm new both asp.net mvc , jquery , in process of designing first inline (in-place) editor html table. in short - when user clicks on e.g "unit price" td
, jquery clones hidden ajax.beginform
replace td
, makes visible. form includes pre-set mvc helpers @html.editorfor(m => m.unitprice)
, @html.validationmessagefor
etc. user can post form , receive tr
controller. works nicely.
now, want extend same functionality td
, example "quantity". have few options:
- add second hidden form page proper helpers, e.g
@html.editorfor(m => m.quantity)
, show user instead. means end hidden form per editable field (could around 10 in total). - continue single form, process cloned dom object jquery before presenting , replace unitprice quantity everywhere required, manually adjust validation properties (
-data-val
) etc etc. - when user clicks on
td
, use jquery make request controller, return appropriate partialview.
question - of these options feasible? there better alternatives? first option not dry, seems maintainable, have no idea how costly keep several unused forms in dom.
thank input.
opted 4th solution keep single hidden form editable fields in view. depending on clicked td
, remove unnecessary fields\elements jquery , keep relevant 1 between form tags before presenting form user.
Comments
Post a Comment