@if (@Model.QuateruserPoints.Count() > 0) { foreach (var data1 in Model.QuateruserPoints) { <div id="@data1.QuarterName" style="width:450px ;background-color:lightgray"> <table class="table table-striped table-bordered" data-tbl-selector="@Model.CurrentQuarterId" id="@data1.QuarterName"> <thead> <tr> <th>User Name</th> <th>Points</th> <th>Action</th> </tr> </thead> <tbody> @foreach (var data2 in data1.Challengepoints) { <tr> <tr> <td>@data2.UserName</td> <td> <input type="number" class="form-control" id="Points" data-selector="txtUserInp" data-username="@data2.UserName" data-challengeid="@data2.ChallengeId" value="@data2.Points" /> @Html.ValidationMessageFor(model => Model.Points) </td> <td class="deleteRow"><a href='#' data-username="@data2.UserName" data-challengeid="@data2.ChallengeId">delete</a></td> </tr> } </tbody> </table> </div> } }
function fillData(data) { $.each(jsonObj,function(index,value){ var htmlTemplate=$('#tblRowUserPoints').html(); $("#userData1").val(JSON.stringify(jsonObj)); var username=value.Unametag; var NewUser=username.split(";"); var replaced=htmlTemplate .replace(/%UserName%/g,NewUser[1]) .replace(/%Points%/g,value.userPoint); $('#H2FY15 > tbody').append(replaced); }); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)