I want to insert rows into a webgrid using Jquery. I will get my values from textboxes on the page.
var grid1 = new WebGrid(Model.dsvm as IEnumerable<ASP_Upload_Version_1.Models.Share_Template>, canPage: true, canSort: false);
@grid1.GetHtml(tableStyle: "table table-sm table-striped table-bordered table-condensed",
htmlAttributes: new { @id = "GridPractice", @class = "table table-sm table-striped table-bordered table-condensed", @style = "width:100%" },
columns: grid1.Columns(
grid1.Column("PracticeArea", "Practice Area"),
grid1.Column("MarketArea", "Market Area"),
grid1.Column(format: @<text>
<a data-title="Are you sure to deactivate this Input?"><i class="fa fa-trash" style="color:red"></i></a></text>, header: "Remove")));
I tried using the following jquery action, yielded no result
$('#Submit_AddRow1').click(function () {
var row = GridPractice.find("tr").eq(1)
SetValue(row, 0, $('#txtPracticeArea').val());
SetValue(row, 1, $('#txtMarketArea').val());
$('#GridPractice').append(row);
})