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

[Solved] Select function does not get called and problems with select if delete/insert too?

1 Answer 53 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.
Thomas
Top achievements
Rank 1
Thomas asked on 25 Sep 2010, 05:17 PM

Trying What: Get a grid with BOTH update/delete AND select working
Method: MVC AJAX style grid


Problem 1: After an insert, delete, or edit, all of the select buttons stop working (they all just point to the current URL and clicking them does not actually do anything. It was confirmed that before the editing, they work fine. This has been failing for both inline editing and the popup editing. Note that for some reason mouse clicking the Update button doesn't work BUT pressing Enter on an edit box works and doesn't break the Select afterwards.

Problem 2: The method specified in databinding.Ajax.Select is NOT used for the select buttons. I believe this can be a little confusing and it should be renamed to databinding.Ajax.Load to not confuse it with the select buttons. Won't this mean that for several grids on the same page, all the grid's will have select buttons going to the same controller method?

View:


<%= Html.Telerik().Grid<HiringSite.Backend.Quiz>(Model)
      .Name("vSomething")
      .Sortable()
      .DataKeys(dataKeys => dataKeys.Add(a => a.Id))
      .ToolBar(commands => commands.Insert())
      .DataBinding(dataBinding => dataBinding.Ajax()
          .Select("GridSelect", "Admin")
          .Insert("GridInsert", "Admin")
          .Update("GridUpdate", "Admin")
          .Delete("GridDelete", "Admin")
          )
            .RowAction(row => row.Selected = ((Guid?)row.DataItem.Id).Equals(ViewData["id"]))                  
      .Columns(columns =>
      {
          columns.Command(commands =>
          {
              commands.Edit();
              commands.Delete();
              commands.Select();
          });
          columns.Bound(a => a.Name).Width(150);
      })
%>

1 Answer, 1 is accepted

Sort by
0
Thomas
Top achievements
Rank 1
answered on 05 Oct 2010, 02:50 AM
I worked around this issue by just using a client template and making my own select button.

Not supporting "select" in ajax is either a bug or it should throw an exception saying that its not supported, rather than just leaving it broken.
Tags
Grid
Asked by
Thomas
Top achievements
Rank 1
Answers by
Thomas
Top achievements
Rank 1
Share this question
or