This question is locked. New answers and comments are not allowed.
I've just started with MVC2 and Telerik Controls, i need to refresh the grid with a filter which will be entered into a separate Textbox. The filter methods of the grid is not an option because of it's incompatibility with Castle ActiveRecord.
$(document).ready(function () {
$('#filterTextBox').change(function () {
var query = $('#filterTextBox').val();
var grid = $('#UserGrid').data('tGrid');
grid.ajax.selectUrl = '/User/_GetUsers?filterText=' + query;
grid.ajaxRequest();
});
});
This what i've got so far it works but i was wondering if there is a better way to access the grids ajax binding or to bind the value of the Textbox to the grid instead of the ViewData value.
dataBinding.Ajax().Select("_GetUsers", "User", new { filterText = (string)ViewData["filterText"] });
I am new to javascript too but the third thought i had was to set the ViewData value via JavaScript but i don't know how to do that and i don't know how to set up a databinding with javascript like the line below. I've read some posts about jquery post methods like this one
Refresh Grid
but the solution doesn't work for me. Is there a better way to refresh the grid with the entered filtering text?
$(document).ready(function () {
$('#filterTextBox').change(function () {
var query = $('#filterTextBox').val();
var grid = $('#UserGrid').data('tGrid');
grid.ajax.selectUrl = '/User/_GetUsers?filterText=' + query;
grid.ajaxRequest();
});
});
This what i've got so far it works but i was wondering if there is a better way to access the grids ajax binding or to bind the value of the Textbox to the grid instead of the ViewData value.
dataBinding.Ajax().Select("_GetUsers", "User", new { filterText = (string)ViewData["filterText"] });
I am new to javascript too but the third thought i had was to set the ViewData value via JavaScript but i don't know how to do that and i don't know how to set up a databinding with javascript like the line below. I've read some posts about jquery post methods like this one
Refresh Grid
but the solution doesn't work for me. Is there a better way to refresh the grid with the entered filtering text?