This question is locked. New answers and comments are not allowed.
I have this grid that is loaded from the server I update the grid via my own javascript function. That works perfectly. I grab the json object from the rest service and pass it to grid.dataBind property it works magnificently. But once I added a .Template column on the dynamic update of the grid the stuff that is supposed to be inserted into that .Template column is not being re-inserted. The below code is my current configuration. I am still playing with some of the features this is why it is so loaded with stuff. I have included the razor grid declaration as well as the javascript in question. Thanks for the replies.
JAVASCRIPT
Html.Telerik().Grid((List<IMRS.Model.WorkOrderRepairLine>)ViewData["workOrderRepairLine"]) .Name("WorkOrderRepairLines") .DataKeys(d => d.Add(o => o.ID)) .Columns(c => { c.Bound(o => o.ID).Visible(false); c.Bound(o => o.ConditionCodeId).Visible(false); c.Bound(o => o.WorkOrderRepairLineStatusId).Title("S").ReadOnly().Width(20); c.Bound(o => o.JobCodeDescription).Title("Description").Width(60); c.Bound(o => o.UnitLocationCodeDescription).Title("Loc").Width(25); c.Bound(o => o.WhyMadeCodeDescription).Title("Why Made").Width(46); c.Bound(o => o.ConditionCodeDescription).Title("Con Code").Width(46); c.Bound(o => o.DefectQuantity).Title("Def Qty").Width(40); c.Bound(o => o.DefectSize).Title("Def Size").Width(50); c.Bound(o => o.RepairQuantity).Title("Rep Qty").Width(50); c.Bound(o => o.RepairSize).Title("Rep Size").Width(50); c.Bound(o => o.ResposibilityCodeDescription).Title("Resp").Width(30); c.Bound(o => o.J2ActivityID).Title("J2 Act").Width(50); c.Bound(o => o.LaborAmount).Title("Labor").Width(51).Format("{0:c}"); c.Bound(o => o.MaterialAmount).Title("Matl").Width(50).Format("{0:c}"); c.Bound(o => o.TaxAmount).Title("Tax").Width(50).Format("{0:c}"); c.Bound(o => o.Authorize).Title("Auth").Width(30).ClientTemplate("<input type=\"checkbox\" disabled=\"disabled\" name=\"Authorize\" id=\"Authorize\" <#= Authorize? checked='checked' : '' #> />"); c.Command(commands => commands.Delete().ButtonType(GridButtonType.Image)).Width(25); c.Template(@<text><span>test</span></text>); }) .DataBinding(databinding => databinding.WebService() .Update("http://imrs/workorder/UpdateWorkOrderJSON/") .Select("http://imrs/workorder/UpdateWorkOrderJSON/") .Insert("http://imrs/workorder/UpdateWorkOrderJSON/") .Delete("http://imrs/workorder/UpdateWorkOrderJSON/") ) .ToolBar(tools => { tools.Insert().ButtonType(GridButtonType.Image); } ) .ClientEvents(events => events .OnLoad("onDataBinding") .OnEdit("editConditionCode") .OnSave("anothertest") .OnDelete("testdelete") .OnDetailViewCollapse("onDetailViewCollapse") .OnDetailViewExpand("onDetailViewExpand") .OnDataBinding("onDataBinding2") .OnRowDataBound("onRowDataBound") .OnRowSelect("onRowSelect") .OnDataBound("onDataBound") .OnColumnResize("onColumnResize") .OnColumnReorder("onColumnReorder") ) .Selectable() .KeyboardNavigation() .Editable( editable => editable.Mode(GridEditMode.InCell)) )JAVASCRIPT
var grid = null; function onDataBinding(result) { grid = $(this).data('tGrid'); }; function GetWorkOrder(id) { $.ajax({ url: 'http://imrs/workorder/detailsjson/' + id + '', data: {}, type: "GET", dataType: "json", jsonpCallback: "localJsonpCallback" }); currentWorOrderID = id }; function localJsonpCallback(json) { currentInvoice = json; grid.dataBind(json.WorkOrderRepairLines); // other stuff not important to question }