Folks,
Would you have an example solution of how remove paging works in ASPX. I am having issues implement it but the existing documentation is unclear as to how. The following is the grid definition:
$("#igResults").igGrid({
defaultColumnWidth: 100,
alternateRowStyles: false,
columns: [
{ headerText: "Add?", key: "IsSelected", dataType: "string", width: "50px", columnCssClass: "defaultColumn" },
{ headerText: "Ticker", key: "Ticker", dataType: "string", width: "50px", columnCssClass: "defaultColumn" },
{ headerText: "Cusip", key: "Cusip", dataType: "string", width: "50px", columnCssClass: "defaultColumn" },
{ headerText: "Name", key: "SecurityName", dataType: "string", width: "95px", columnCssClass: "defaultColumn" },
{ headerText: "Starmine Portfolio", key: "StarminePortfolioName", dataType: "string", width: "95px", columnCssClass: "defaultColumn" },
{ headerText: "Start Date", key: "StartDate", dataType: "date", width: "75px", columnCssClass: "defaultColumn" },
{ headerText: "End Date", key: "EndDate", dataType: "date", width: "75px", columnCssClass: "defaultColumn" },
{ headerText: "Startmine Analyst", key: "StarmineAnalystName", dataType: "string", width: "90px", columnCssClass: "defaultColumn" },
{ headerText: "Analyst Region", key: "AnalystRegionName", dataType: "string", width: "90px", columnCssClass: "defaultColumn" },
{ headerText: "MFS Region", key: "MfsRegionName", dataType: "string", width: "70px", columnCssClass: "defaultColumn" },
{ headerText: "MFS Country", key: "MfsCountryName", dataType: "string", width: "70px", columnCssClass: "defaultColumn" },
{ headerText: "MFS Sector", key: "MfsSectorName", dataType: "string", width: "70px", columnCssClass: "defaultColumn" },
{ headerText: "Global Sector", key: "GlobalSectorName", dataType: "string", width: "70px", columnCssClass: "defaultColumn" },
{ headerText: "Mfs Industry", key: "MfsIndustryName", dataType: "string", width: "70px", columnCssClass: "defaultColumn" },
{ headerText: "Factset Industry", key: "FrsIndustryName", dataType: "string", width: "70px", columnCssClass: "defaultColumn" },
{ headerText: "MFS Analyst", key: "MfsAnalystName", dataType: "string", width: "90px", columnCssClass: "defaultColumn" },
{ headerText: "Universe", key: "CoverageUniverseName", dataType: "string", width: "70px", columnCssClass: "defaultColumn" }
],
primaryKey : "Cusip,StartDate",
dataSourceUrl : "StarminePortfolios.aspx/GetPagingData",
caption: "Coverage Universe Override",
autoGenerateColumns: false,
responseDataKey : "records",
features: [
{
name: "Sorting",
type: "local"
},
name: "Paging",
type: "remote",
pageSize: 50,
recordCountKey: "TotalRecordsCount",
pageIndexChanging: function (ui, args) {
}
]
});
I load the grid initially with an ajax call, like so:
function FilterGrid() {
var data = {
tickerList: $('#txtTickerList').val(), mfsAnalystId: StringListValue('#lstMFSAnalystFilter'), frsIndustry: StringListValue('#lstFRSIndustryFilter'),
mfsIndustry: StringListValue('#lstMFSIndustryFilter'), mfsRegion: StringListValue('#lstMFSRegionFilter'), analystRegion: StringListValue('#lstAnalystRegionFilter'),
mfsCountry: StringListValue('#lstMFSCountryFilter'), mfsSector: StringListValue('#lstMFSSectorFilter'),
globalSector: StringListValue('#lstGlobalSectorFilter'), coverageUniverse: StringListValue('#lstCoverageUniverse'), starminePortfolioId: StringListValue('#lstStarminePortfolioFilter'),
starmineAnalystId: StringListValue('#lstStarmineAnalystFilter'), currentStarminePortsOnly: $('#chkCurrentStarminePortsOnly').prop('checked'), pageSize: 50 , pageIndex: 0
};
$.ajax({
type: "POST",
url: "StarminePortfolios.aspx/GetData",
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
data = response.d;
BindToGrid("igResults", data);
error: function (jqXHR, textStatus, errorThrown) {
var errorMsg = eval('(' + jqXHR.responseText + ')');
$("#dialog-splash").dialog("close");
alert(errorMsg.Message);
Server side method for this:
[System.Web.Services.WebMethod(EnableSession = true)]
public static List<StarminePortfoliosSecurity> GetData( string tickerList,string mfsAnalystId,string frsIndustry,
string mfsIndustry, string mfsRegion, string analystRegion,string mfsCountry,string mfsSector,
string globalSector,string coverageUniverse,string starminePortfolioId,string starmineAnalystId,bool currentStarminePortsOnly = true , int pageSize = 100 , int pageIndex = 0)
string userLoginId = HttpContext.Current.Session["NT_LOGINID"].ToString();
List<StarminePortfoliosSecurity> list = Mfs.Invest.InvestData.AnalystCoverage.StarminePortfoliosSecurity.GetStarminePortfolioSecuritiesV2(tickerList, mfsAnalystId, frsIndustry, mfsIndustry, mfsRegion, analystRegion, mfsCountry, mfsSector, globalSector, coverageUniverse, starminePortfolioId, starmineAnalystId, currentStarminePortsOnly);
return list;
After this I click on the page numbers but it doesn't call the GetPageData method which is defined on the server like so:
public static List<StarminePortfoliosSecurity> GetPagingData(int pageSize = 100, int pageIndex = 0)
//string userLoginId = HttpContext.Current.Session["NT_LOGINID"].ToString();
// List<StarminePortfoliosSecurity> list = Mfs.Invest.InvestData.AnalystCoverage.StarminePortfoliosSecurity.GetStarminePortfolioSecuritiesV2(tickerList, mfsAnalystId, frsIndustry, mfsIndustry, mfsRegion, analystRegion, mfsCountry, mfsSector, globalSector, coverageUniverse, starminePortfolioId, starmineAnalystId, currentStarminePortsOnly);
return new List<StarminePortfoliosSecurity>();
Any help would be greatly apprieciated!
I should also add that I need it to be used in an ASPX page