Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1150
igGrid DataSource vs DataSourceUrl
posted

I was wondering which one is recommended to use ? What are the pros & cons ?

if DataSourceUrl is the better option, can you help me on how do I pass parameter to an MVC ActionMethod that I set as the DataSourceUrl?

Thanks,

Jeffrey

Parents
  • 23953
    Suggested Answer
    Offline posted

    Hi Jeffrey,

    jAndika said:
    I was wondering which one is recommended to use ? What are the pros & cons ?

    Simply speaking DataSource is used in a local data binding and DataSourceUrl is used in remote data binding scenarios.
    They are designed to solve different use cases so it depends on your requirements. If you want remote Paging, Sorting or Filtering you should use DataSourceUrl. This is the better choice if you have large data set. The data will be loaded and extracted on demand.
    If you have small data set then you can use DataSource. This way the data will be downloaded on the client and all Paging, Sorting, Filtering operations will be done on the client.
    You should read Developing ASP.NET MVC Applications with igGrid topic in order to get better understanding of these options. Look at the Data Binding section where these two options are described in greater detail.

    jAndika said:
    if DataSourceUrl is the better option, can you help me on how do I pass parameter to an MVC ActionMethod that I set as the DataSourceUrl?

    You can use $.ig.DataSource.options.urlParamsEncoded option. Here is a sample code:

    $("#grid").data("igGrid").dataSource.settings.urlParamsEncoded = function (owner, params) {

    params.filteringParams.$filter = params.filteringParams.$filter + "place your params here";

    };

    Hope this helps,
    Martin Pavlov
    Infragistics, Inc. 

Reply Children
No Data