Hi,
Is there a way to tell igGrid to re-get and rebind the data according to specified DataSourceUrl ? I need to filter down the data in igGrid, so I'd like to pass in user input data (in a form) to the DataSourceUrl, and call it manually when user hit Search/Filter button.
Thanks,
Jeffrey
Hi Jeffrey,
Try to use igGrid dataBind method like this:
$(".selector").igGrid("dataBind");
Hope this helps,Martin PavlovInfragistics, Inc.
Thanks for the reply..
Is there any way I can pass in parameter to the dataSourceUrl ?
I'm working on a search page, and I'm thinking about getting the search inputs from textboxes using jquery then pass it in to the MVC ActionMethod defined as the DataSourceURL. Or is there a better way to do this ?
Thanks
I haven't tried the filtering yet.. But what works for me is changing the dataSourceObject during runtime, and pass in the search inputs as query string. So, inside a button click handler, I'm doing this:
$('#btnSearch').click(function (event) {
var url = 'GetData';
//grab all search inputs value var desc = $('#txtDesc').attr('value');
var params = (desc && 'Description=' + desc + '&');
if (params) { url += '?' + params; url = url.slice(0, -1); // remove leading ampersand } $('#gridMatrix').igGrid('dataSourceObject', url); $('#gridMatrix').igGrid('dataBind'); });
Thanks for the help Martin
jAndika said:Is there any way I can pass in parameter to the dataSourceUrl ?
I answered you in this forum post: http://es.infragistics.com/community/forums/t/72166.aspx
jAndika said:I'm working on a search page, and I'm thinking about getting the search inputs from textboxes using jquery then pass it in to the MVC ActionMethod defined as the DataSourceURL. Or is there a better way to do this ?
I think that the easiest way is to use igGridFiltering.filter method. If you have set DataSourceUrl (remote data binding) then this method will call DataSourceUrl with the proper request string and all the filtering will be done for you on the server(look at igGrid Filtering section Remote Filtering).
Best regards,Martin PavlovInfragistics, Inc.