I have two problems in igGrid when remote Paging.
The first, I can not get the queryString in my MVC controller when my igGrid is paging that is using http POST method. My igGrid is initialized like below:
When my igGrid is using http POST method, I can not get the queryString like pageIndex, pageSize in my MVC controller.
If I remove the code requestType:’post’ in my igGrid , the grid use http GET method to remote paging, And it is work to get the queryString like pageIndex, pageSize in my MVC controller.
My Second problem is that : Is there anyway to post the data when igGrid is remote paging ? Because I do a practice that I want get the data from user by igEditors in my webpage and then return the information to user by showing in my igGrid. So, I use the button to create an ajax request which is included the data what the user input in the igEditors, and I can use the data from ajax request in my controller to access my database. But when I click the “Next” button in igGrid for changing the igGrid’s page, I don’t know how to get the data what user input in my webpage when igGrid is doing remote paging to my controller that is set from the dataSourceUrl.
As for your first question, I believe you can receive the parameters by defining arguments in your GetData().
e.g.
public ActionResult GridGetData(string page, string pageSize) { int _currentPageIndex = Convert.ToInt32(page); int _pageSize = Convert.ToInt32(pageSize); ... }
For details, please refer to the attached sample.
igGrid_remote_paging.zip
For your second question, I will update here as I have progress on it.
If you have any question with this, please let me know.
Best regards,Yuki MitaDeveloper Support EngineerInfragistics Inc.www.infragistics.com/support
Thank you very much. I appreciate your assistance.
According to your sample for my first question, I can get the parameters in the controller, but I can not understand how it works that I can receive the parameters by defining arguments in my controller. Could you show me which condition I should define arguments in my controller?
Thank you very much! It's very helpful.
Hello Lai,
For your second question, you can use urlParamsEncoded of the grid dataSource(igDataSource). The attached is an updated sample that implements this feature. You can also refer to the forum post here.
https://ko.infragistics.com/community/forums/f/ignite-ui-for-javascript/108655/send-additional-parameters-with-datasourceurl-angular2
igGrid_remote_paging - 2.zip
Hi Lai,
I am still working on the way how to pass a value of igTextEditor along with paging information. I will update you as I have progress on it.
As for the parameter of igGridPaging, igGridPaging automatically generate parameters for the page index and the page size. You can refer to the following help page.
https://www.igniteui.com/help/iggrid-paging#remote
In the attached sample earlier, pageIndexUrlKey is set to “page”, and pageSizeUrlKey is set to “pageSize” respectively so that these are passed to the action in the controller. You can also check what will be passed from developer tool of your browser. Please refer to the screenshot.