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
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
Hi Jeffrey,
jAndika said:Is there any way I can pass in parameter to the dataSourceUrl ?
I answered you in this forum post: http://ko.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.
Martin,
One more question, when using igGrid should we use DataSource or DataSourceURL ? is one better than the other ? I think I read somewhere that remote paging/sorting does not work if the grid does not use DataSourceURL
Thanks
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 ?
Try to use igGrid dataBind method like this:
$(".selector").igGrid("dataBind");
Hope this helps,Martin PavlovInfragistics, Inc.