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

[Solved] Attaching javascript function on grid in server-side

0 Answers 10 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Berk
Top achievements
Rank 1
Berk asked on 15 Jan 2013, 01:57 PM
In my controller class I have a generic grid builder method like:
public static GridBuilder<T> InterGrid<T>(this HtmlHelper helper, String GridName) where T : class
{
    var pagerStyleFlags = new[]
    {
        new { Key = "nextPrevious", Value = GridPagerStyles.NextPreviousAndNumeric },
        new { Key = "pageSize", Value = GridPagerStyles.PageSizeDropDown }
    };
    GridPagerStyles pagerStyles = GridPagerStyles.NextPreviousAndNumeric;
    foreach (var pagerStyleFlag in pagerStyleFlags)
    {
        pagerStyles |= pagerStyleFlag.Value;
    }
 
    return helper.Telerik().Grid<T>().Name(GridName)
            .Scrollable(scrolling => scrolling.Enabled(false))
            .Sortable(sorting => sorting.Enabled(true))
            .Pageable(paging => paging.Enabled(true).PageSize(int.Parse(ConfigurationManager.AppSettings.Get("gridPageSize")), SystemConst.getSizesInPagerDropDown())
                .Position(GridPagerPosition.Bottom).Style(pagerStyles))
            .Groupable(grouping => grouping.Enabled(true))
            .Filterable(filtering => filtering.Enabled(true))
            .Footer(true)
            .EnableCustomBinding(true)
            .TableHtmlAttributes(new { @class = "table responsive-table" })
            ;
}

I try to attach a function so that when user change page size from combobox, a javascript function should be called. How can I achieve that?
Tags
General Discussions
Asked by
Berk
Top achievements
Rank 1
Share this question
or