Hi there,
i'm doing some researches using igniteui 16.1, i want to use some of the iggrid's features (paging,sorting etc) remotely , so I use datasourceurl property like this: dataSourceUrl: "/Dictionary/Dic_Country/GetList".
and while sorting or changing page in iggrid, iggrid passes a url to server with query strings like this:
http://localhost:26591/Dictionary/Dic_Country/GetList?sort(name_en)=asc&pk=id&_=1463477978984,
Meanwhile , I have some input elements in my page,i need to pass the data in input elements to server side while sorting or changing page, i want to add my own parameters behind datasourceurl, but it seems like there is no way to edit iggrid's datasourceurl, i want to know while doing sorting , paging remote, is there any possiable to pass some more data to server side?
Sorry for my poor english, any reply will help, thank you.
Hello Shi,
When the grid is set up to use remote features, Ajax requests are used for data interactions. Having remote features such as Paging allows for working with very large sets without the need to bind the igGrid to the entire data initially which can greatly benefit performance.
In order to take advantage of the remote features functionality the controller action method responsible for Sorting, Filtering and Paging should be decorated with GridDataSourceAction attribute.
You can refer the following API document describe more about Remote features.
https://www.igniteui.com/help/igtreegrid-remote-features#samples
You can refer the following sample demonstrates how to setup the remote features of the Tree Grid: sorting, filtering and paging.
https://www.igniteui.com/tree-grid/remote-features
If you're not implementing paging yourself then in order for remote paging to work you need to set DataSourceUrl to point to an action method decorated with GridDataSourceAction attribute. Check out this sample which demonstrates remote paging:
https://www.igniteui.com/grid/paging
More more information refer the following Forum explained by martin.
https://es.infragistics.com/community/forums/f/ignite-ui-for-javascript/77099/remote-paging
Please let me know if you need further assistance.
Hi, Jain:
Thanks for your reply.
Actually in order to use remote features, I do decorate the controller action method responsible for Sorting, Filtering and Paging with GridDataSourceAction attribute, and I found out igNite grid sent a request back and added some query strings in the dataSourceUrl automaticly, the Url generated like this: http://localhost:26591/Home/CrewList?sort(name)=desc&page=0&pageSize=12&pk=id&_=1465226017812.
But in my application , i have to allow users to enter something in a input element in the page, when using remote features , i need to fetch the user input, and add the user input in query string too, so i can handle the user input in the controller action,and finally the url sent back might be like this :
http://localhost:26591/Home/CrewList?sort(name)=desc&page=0&pageSize=12&pk=id&_=1465226017812&userinput=something(this part of query string in bold is what i want to add in the generated url).
So my question is, when using remote features, is it possible to add some query strings in the generated datasourceUrl?
thanks a lot.
Hi Yan,
When you need to change something in the URL, before it is requested, you can use the urlParamsEncoding and urlParamsEncoded grid events, this forum topic can help:
https://es.infragistics.com/community/forums/f/ignite-ui-for-javascript/65946/binding-to-json-object-s-complex-properties
for more information about dynamic datasource of iggrid in the following forum Vasya provided very usefull information and a sample application.
https://es.infragistics.com/community/forums/f/ignite-ui-for-javascript/89773/autogeneratecolumns-true-does-not-render-rows-dynamic-datasource-of-iggrid
Please let me know if I may be further assistance.
That's really worked for me, thank you very much
Thank you for the update.