This question is locked. New answers and comments are not allowed.
Hi
I have one small issue when loading a new grid. I am trying to load the last used filters on initial load but a getting a undefined value for the grid. I have tried both in the OnLoad and Document ready but has the same result.
Here is a snippet of the grid definition and Java. I am saving the filter in a hidden field which is retuning the value as expected. I am using VS2010 and 2010.1.591.40 (MVC2). I hope that is clear.
Also once i have retreived the filter is it possible to apply it to my query to limit it as it does for teh Ajex call.?
John
I have one small issue when loading a new grid. I am trying to load the last used filters on initial load but a getting a undefined value for the grid. I have tried both in the OnLoad and Document ready but has the same result.
Here is a snippet of the grid definition and Java. I am saving the filter in a hidden field which is retuning the value as expected. I am using VS2010 and 2010.1.591.40 (MVC2). I hope that is clear.
Also once i have retreived the filter is it possible to apply it to my query to limit it as it does for teh Ajex call.?
John
<%: Html.HiddenFor(Function(model) model.Filter)%> <script type="text/javascript"> $(document).ready(function () { var grid = $('#MyBatchBarcodesGrid').data('tGrid'); grid.filter('<%= model.filter %>'); }); </script> <script type="text/javascript"> function onDataBinding(e) { var grid = $(this).data('tGrid'); $('#Filter').attr('value', grid.filterBy); } function onLoad(e) { var grid = $(this).data('tGrid'); //grid.filter('<%= model.filter %>'); } </script> <%= Html.Telerik() _ .Grid(Of AIMSWeb.MyBatchBarcodesItemViewModel)() _ .Name("MyBatchBarcodesGrid") _ .Scrollable(Function(scrolling) scrolling.Height(500)) _ .Pageable(Function(paging) paging.PageSize(20)) _ .DataKeys(Function(keys) keys.Add(Function(o) o.JobID)) _ .ClientEvents(Function(Events) Events.OnDataBinding("onDataBinding")) _ .Columns(Sub(columns) columns.Bound(Function(o) o.JobID).Format(Html.IconActionLink("~/Content/Images/icons/icon_pdf.gif", "Print Barcode", "BatchBarcodePrint", "My", New With {.id = "{0}"})).Encoded(False).Title("").Filterable(False).Sortable(False).Width(38) columns.Bound(Function(o) o.JobID).Width(60).Title("ID") columns.Bound(Function(o) o.Claimant1).Width(150).Title("Name") columns.Bound(Function(o) o.Claimant1Detail).Width(300).Title("Address") columns.Bound(Function(o) o.Claimant1PostCode).Width(60).Title("Post Code") columns.Bound(Function(o) o.Claimant1PhoneGeneral).Width(100).Title("Home Phone") columns.Bound(Function(o) o.Claimant1PhoneWork).Width(100).Title("Work Phone") columns.Bound(Function(o) o.Claimant1PhoneMobile).Width(100).Title("Mobile") End Sub) _ .DataBinding(Sub(dataBinding) dataBinding.Ajax().Select("_AjaxBatchBarcodes", "My") End Sub) _ .Scrollable(Function(scrolling) scrolling.Enabled(True)) _ .Sortable(Function(sorting) sorting.Enabled(True)) _ .Pageable(Function(paging) paging.Enabled(True)) _ .Filterable(Function(filtering) filtering.Enabled(True)) _ .Groupable(Function(grouping) grouping.Enabled(True)) _ .Footer(True)%>