views:

15

answers:

1

As I have an editor-list, that needs to have additional edit lines, I found this solution for the problem:
Mvc list editor by Stevens Anderson

this works perfectly, excepts that every time when I add a new line, the whole Form is set back to the default values. You can see the behavior in the demo of the linked page. Try to edit the value of an input box and then add a new line without saving.

Why isn't it possible just to add a new editor line, without changing any data.

Thanks, Daniel

A: 

Ok, I've found a workaround

Instead of using the Html.AjaxLink I am now using a custom JavaScript function with jQuery

    function newProjectExpenseRow() {
      jQuery.get("/Controller/Action", function (response) {
          $(response).insertBefore("#id");
      });         
    }

it now gets the Control from the controller/action and inserts the result before the #id element

dhaefi

related questions