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

[Solved] Clientside soring is not working when GridOperationMode is set to Client

1 Answer 13 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.
Vijay
Top achievements
Rank 1
Vijay asked on 03 Dec 2012, 06:36 AM
Clientside soring is not working when GridOperationMode is set to Client.

Dim gridBuilder = Html.Telerik().Grid(Of U2.UserGroupDetail) _
            .Name("UserProperties") _
            .ClientEvents(Function(e) e.OnDataBinding("showProgress").OnDataBound("hideProgress")) _
            .DataKeys(Function(keys) keys.Add(Function(p) p.GUID)) _
            .DataBinding(Function(dataBinding) dataBinding.Ajax().[Select]("Action", "Controller").OperationMode(GridOperationMode.Client)) _
            .Columns(Sub(columns)
                          columns.Bound(Function(o) o.LoginName).Title("Login Name").Width(120)
                          columns.Bound(Function(o) o.FirstName).Title("First Name").Width(120)
                          columns.Bound(Function(o) o.LastName).Title("Last Name").Width(120)
                          columns.Bound(Function(o) o.SMTPAddress).Title("Email ID").Width(250)
                  End Sub).
            Sortable().
            Filterable().
            Footer(False).
            Selectable().
             Resizable(Function(resizing) resizing.Columns(True)).
            Scrollable(Function(scrolling) scrolling.Enabled(True))
            gridBuilder.Render()
function onClickSortButton()
{
    var grid = $("#UserProperties").data("tGrid");
    grid.sort("LoginName-desc");
}

1 Answer, 1 is accepted

Sort by
0
Vijay
Top achievements
Rank 1
answered on 03 Dec 2012, 06:40 AM
I need to call twice to sort.
on 1st call it add only sorting direction arrow in column header
on 2nd call it actually sort grid.
function onClickSortButton()
{
    var grid = $("#UserProperties").data("tGrid");
    grid.sort("LoginName-desc");
    grid.sort("LoginName-desc");
}
Tags
Grid
Asked by
Vijay
Top achievements
Rank 1
Answers by
Vijay
Top achievements
Rank 1
Share this question
or