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
380
Issue with setting pageSize and "dataBind" or setting "dataSource" option overwrites it with last value of pageSize?
posted

We tried to set the pageSize before reloading ( "dataBind" ) the grid.
From the debugging we did, it was noticed that right after setting the new dataSource (even though the dataSource itself has the new value of the pageSize ) the last value is applied again so what we see in the UI is flicker.
For a second or so the new ( "25" ) size is set and right after that the grid goes to the previous old value.


                                var jsonPDataSourceOptions = {
                                    urlType: 'remoteUrl',
                                    dataSource: ajaxUrl,
                                    paging: {
                                        enabled: true,
                                        pageSize: 25
                                    },
                                    responseDataKey: 'd.results.data'
                                };

                                var igDs = new $.ig.JSONPDataSource(jsonPDataSourceOptions);
                                igDs.pageSize(25);
                                self.options.gridOptions.dataSource = igDs;
                                
                                
                                $(self.options.jobsGridSelector, self.element).igGrid("option", "dataSource", igDs);
                                $(self.options.jobsGridSelector, self.element).igGrid("dataBind");