This question is locked. New answers and comments are not allowed.
Hi,
I have a grid for EntregaTalonario set in popup edit mode, and an editor template for that model in which I've another grid for model Talonario, that have two properties with DataType("Integer") attribute. The problem is when the popup shows, the grid for Talonario have rendering problems (see attached image) and when I comment the two properties with DataType("Integer") everything is ok. The other issue I detect is in Remote validation, sometimes I get this error with firebug:
a is undefined
http://localhost:1781/Scripts/2011.2.825/jquery.validate.min.js
Line 34
I think this happens when the request is still in the server but the input lose focus because I click in other place and then is replaced by a span, but when the response came, jquery couldn't find that input
Models:
View:
and Editor Template:
I have a grid for EntregaTalonario set in popup edit mode, and an editor template for that model in which I've another grid for model Talonario, that have two properties with DataType("Integer") attribute. The problem is when the popup shows, the grid for Talonario have rendering problems (see attached image) and when I comment the two properties with DataType("Integer") everything is ok. The other issue I detect is in Remote validation, sometimes I get this error with firebug:
a is undefined
http://localhost:1781/Scripts/2011.2.825/jquery.validate.min.js
Line 34
I think this happens when the request is still in the server but the input lose focus because I click in other place and then is replaced by a span, but when the response came, jquery couldn't find that input
Models:
public class Talonario { [ScaffoldColumn(false)] public Decimal ID { get; set; } [ScaffoldColumn(false)] public Decimal ID_ENTREGA_TALONARIO { get; set; } [Required] [Remote("CheckInterval", "Talonario", AdditionalFields = "NUMERO_FINAL", ErrorMessage = "El intervalo usado no es válido.")] //[DataType("Integer")] public int NUMERO_INICIAL { get; set; } [Required] [Remote("CheckInterval", "Talonario", AdditionalFields = "NUMERO_INICIAL", ErrorMessage = "El intervalo usado no es válido.")] //[DataType("Integer")] public int NUMERO_FINAL { get; set; } ... }public class EntregaTalonario{ [ScaffoldColumn(false)] public Decimal ID { get; set; } [Required] [Display(Name = "Serie")] public String SERIE { get; set; } [Required] [Display(Name = "Nombre recibe")] public String NOMBRE_RECIBE { get; set; } public IEnumerable<Talonario> Talonarios { get; set; } ... }
View:
@using TasasServicios.Areas.retenciones.Models@model IEnumerable<EntregaTalonario>@{ ViewBag.Title = "Talonarios";}@Html.Partial("Header_Contribuyente")@{ Html.Telerik().Grid<EntregaTalonario>().Name("entrega_talonario").Columns(cols => { cols.Bound(r => r.ID_CONTRIBUYENTE_RETENEDOR).Hidden(); cols.Bound(r => r.FECHA_ENTREGA).Title("Fecha"); cols.Bound(r => r.NOMBRE_ENTREGA).Title("Nombre entrega"); cols.Bound(r => r.NOMBRE_RECIBE).Title("Nombre recibe"); cols.Bound(r => r.SERIE).Title("Serie"); }) .DetailView(det => det.ClientTemplate(Html.Telerik().Grid<Talonario>().Name("talonario_<#=ID#>") .DataKeys(key => key.Add(t => t.ID)) .DataBinding(dataBinding => dataBinding.Ajax().Select("Select", "Talonario", new { ID_ENTREGA_TALONARIO = "<#=ID#>" })) .Columns(cols => { cols.Bound(t => t.NUMERO_INICIAL).Title("Número inicial"); cols.Bound(t => t.NUMERO_FINAL).Title("Número final"); }) .ToHtmlString())) .DataKeys(k => k.Add(r => r.ID)) .Editable(e => e.Mode(GridEditMode.PopUp).DefaultDataItem(new EntregaTalonario { FECHA_ENTREGA = DateTime.Now, NOMBRE_ENTREGA = User.Identity.Name })) .ToolBar(t => t.Insert().ButtonType(GridButtonType.ImageAndText)) .DataBinding(dataBinding => { dataBinding.Ajax().Select("Select", "EntregaTalonario"); dataBinding.Ajax().Insert("SaveChanges", "EntregaTalonario"); }) .Filterable() .Pageable() .Sortable() .Selectable() .Render();}and Editor Template:
@using TasasServicios.Areas.retenciones.Models@model EntregaTalonario<fieldset style="font-size: 1.2em; border-radius: 8px;"> @Html.ValidationSummary() <div class="row col4"> <div> @Html.LabelFor(m => m.FECHA_ENTREGA)<br /> @Html.Telerik().DatePickerFor(m => m.FECHA_ENTREGA) @Html.ValidationMessageFor(m => m.FECHA_ENTREGA) </div> <div> @Html.LabelFor(m => m.NOMBRE_ENTREGA)<br /> @Html.DisplayFor(m => m.NOMBRE_ENTREGA) @Html.ValidationMessageFor(m => m.NOMBRE_ENTREGA) </div> <div> @Html.LabelFor(m => m.NOMBRE_RECIBE)<br /> @Html.EditorFor(m => m.NOMBRE_RECIBE) @Html.ValidationMessageFor(m => m.NOMBRE_RECIBE) </div> <div> @Html.LabelFor(m => m.SERIE)<br /> @Html.EditorFor(m => m.SERIE) @Html.ValidationMessageFor(m => m.SERIE) </div> <p> </p> </div> @{ Html.Telerik().Grid<Talonario>().Name("talonario") .Editable(e => e.Mode(GridEditMode.InCell)) .DataKeys(k => k.Add(t => t.ID)) .DataBinding(binding => binding.Ajax().Update("SaveChanges", "Talonario").Select("Select", "Talonario", new {id = 0})) .Columns(cols => { cols.Bound(t => t.NUMERO_INICIAL).HtmlAttributes(new { name = "NUMERO_INICIAL" }).Title("Número inicial"); cols.Bound(t => t.NUMERO_FINAL).HtmlAttributes(new { name = "NUMERO_INICIAL" }).Title("Número final"); }) .ToolBar(t => t.Insert()) .Render(); }</fieldset>