This is a migrated thread and some comments may be shown as answers.

[Solved] Using Grid with GridEditMode.InCell (or any edit mode) cause the Client Side unobtrusive validation of the form on the page not working!!

1 Answer 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mo2011ti
Top achievements
Rank 1
mo2011ti asked on 16 Feb 2012, 11:50 PM
Hi,

i have a form named MyForm1 on the page,
i'm using client side validation on that form, its work fine.

if( $('#MyForm1').valid() ){
// get values from inputs of this form and run some ajax update.
}
i also have a Grid, it's NOT inside this form or any other form
the grid is ajax binding and works fine
When i'm changing this Grid to Batch Editing.
the client validation not work anymore, i get an error
on this line: $('#MyForm1').valid()
Unable to get value of the property 'call': object is null or undefined

hereunder is my code.
please please Please help, i must solve this asap.
Thanks
Mor


javascript files on page:
  
            .("jquery-1.7.1.min.js")
  
            .("jquery.validate.min.js")
  
            .("jquery.validate.unobtrusive.min.js")
  
  
  
 <% using (Html.BeginForm("", "", FormMethod.Post, new { id = "MyForm1" }))
  
       { %>
  
     <%: Html.TextBoxFor(m=>m.Property1) %>
  
     <%: Html.TextBoxFor(m=>m.Property2) %>
  
     <button onclick="ValidateForm_and_get_Property1+2_Values_DoSomeAjax__Works_fine_when_Grid_Not_Editable"
  
 <%  } %>
  
  
  
    Html.Telerik().Grid<Models.Item>()
  
                    .Name("MyGridName")
  
                    .DataKeys(keys =>
  
                    {
  
                        keys.Add(p => p.ItemId).RouteKey("ItemId");
  
                    })
  
                    .Columns(columns =>
  
                    {
  
                               columns.Bound(c => c.ItemName)
  
                               columns.Command(commands => commands.Delete()).Width(90).Title("Delete")
  
                      })
  
                       .Editable(e=>e.Enabled(true).Mode(GridEditMode.InCell))   /// here starts the problem...
  
                        .Render();

1 Answer, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 25 Apr 2012, 06:21 PM
http://stackoverflow.com/questions/7283022/telerik-mvc-window-jquery-validator-problem

1)I include jquery.validate.unobtrusive.min.js files in partial view, where is form
Tags
Grid
Asked by
mo2011ti
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Share this question
or