how to add new row dynamically in webgrid or in table in mvc4 on change of last column value using jquery.
Please reply..its urgent..
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted May 8, 2014, 1:17 AM
hi,
Please refer
http://www.dotnet-tricks.com/Tutorial/mvc/E2S9150113-Enhancing-WebGrid-with-Insert-Update-and-Delete-Operations.html
http://www.mikesdotnetting.com/Article/223/Adding-a-New-Row-In-The-Razor-WebGrid
hope this will help you.
Rukasana DangePosted May 8, 2014, 12:39 AM
@grid.GetHtml(columns: grid.Columns(grid.Column("Account Code"),
grid.Column("Doc No"),
grid.Column("Doc Date"),
grid.Column("Currency Id"),
grid.Column("Currency Code"),
grid.Column("Price", format: @
$(function () {
$('#price').on('change', function () {
$('table').append('
'
'
'
'
'
'
'
});
Jaganathan BantheswaranPosted May 5, 2014, 8:38 AM
$('.your-last-column').on('change', function () { //code here });
Rukasana DangePosted May 5, 2014, 6:19 AM
Thanks
Jaganathan BantheswaranPosted May 5, 2014, 5:36 AM
You have to manually add the table row when user clicks on the Add button.
WebGrid: