1

i am looking for a some way to add dynamicly row in grid based on framework nonfactors. I dont found any solution in internet.

Here, i have a some example to create grid in view

@(Html
    .Grid(Model)

    .Build(columns =>
    {
        columns.Add(model => Html.TextBox(nameof(SysRecord.RecId),model.RecId)).Css("hidden");
        columns.Add(model => Html.TextBoxFor(x=>model.Name)).Titled("Name").MultiFilterable(true);
        columns.Add(model => Html.TextBoxFor(x=>model.Nip)).Titled("Nip").MultiFilterable(false);
    })
    .Attributed( new { url = Url.Action( "CrudAction","Company") } )
    .MultiFilterable()
    .Filterable()
)

<button id="mvc-grid-create" > create </button>
<button id="mvc-grid-update" > update </button>
<button id="mvc-grid-remove" > remove </button>

And the question it is how to create a row using jQuery?
i can use .append or after(' '); but this solution needs to fill html tag, whats i dont want.
i can too clone the last row, but what if none exists?

i found a few solution in google, but none works:
for example, using method on data grid (.js) .addRow() and .addNewRow()

sorry for my bad English :(

live-love
  • 48,840
  • 22
  • 240
  • 204
neuser
  • 107
  • 13

1 Answers1

0

The grid you are working with is purely server side so it doesn't have methods like addRow or addNewRow which are available in client side based grid. So your options are limited to appending raw html or changing the grid library.

Gin Fala
  • 11
  • 1
  • 3