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
330
aspx grid updating
posted

I have a grid which I am attempting to update using a webmethod in aspx.  I get an error coming back about server not sending a proper response back.  When I debug, the method is not being called.   I think it has to do with the method signature.  The grid loads up just fine and the paging works as well.  I have simplified the grid but subbing in a json object for the data source.

var subs = [

{ IDX: 1, BarraModelId: "USE3L", BarraId: "KORACL3", AltBarraId: "USA9EX1" }

];

$("#SecuritySubs").igGrid({

columns: [

{ key: "IDX", dataType: "number", width: "10px" },

{ headerText: "Barra Model ID", key: "BarraModelId", dataType: "string", width: "150px"},

{ headerText: "Barra Id", key: "BarraId", dataType: "string", width: "150px" },

{ headerText: "Alternate Barra Id", key: "AltBarraId", dataType: "string", width: "150px" }

],

autoCommit: true,

defaultColumnWidth: 100,

alternateRowStyles: false,

primaryKey: "IDX",

requestType: "POST",

responseDataKey: "d.Items",

caption: "Barra Security Substitution",

// dataSourceUrl: "Main.aspx/GetSubstitutions",

dataSource: subs,

updateUrl: "Main.aspx/Update",

autoGenerateColumns: false,

features: [

{

name: "Filtering",

type: "local",

mode: "advanced",

filterDialogWidth: 600,

filterDialogHeight: 350,

filterDialogColumnDropDownDefaultWidth: 175,

filterDialogFilterDropDownDefaultWidth: 125,

filterDialogContainment: "window"

},

{

name: "Sorting",

type: "local",

columnSettings: [

{

columnIndex: 0,

allowSorting: false

}]

},

{

name: "Paging",

type: "remote",

pageSize: 50,

recordCountKey: "d.TotalRecordsCount",

pageSizeUrlKey: "pageSize",

pageIndexUrlKey: "pageIndex",

currentPageIndex: 0,

persist: false,

pageIndexChanging: function (event, args) {

},

pageIndexChanged: function (event, args) {

}

},

{

name: "Selection",

mode: "row"

},

{

name: "Updating",

enableAddRow: true,

editMode: "row",

editRowEnded: function (evt, ui) {

if (ui.update || ui.rowAdding) {

// alert('saving');

$("#SecuritySubs").igGrid("saveChanges");

}

},

saveChangesErrorHandler: function (jqXHR, textStatus, errorThrown) {

// debugger

$("#message").text("An error occurred while saving the changes. Error details: " + errorThrown);//.fadeIn(3000).fadeOut(5000);

},

enableDeleteRow: true,

rowEditDialogContainment: "owner",

showReadonlyEditors: false,

enableDataDirtyException: false,

showDoneCancelButtons: true,

columnSettings: [

{

columnKey: "IDX",

readOnly: true

},

{

columnKey: "BarraModelId",

editorType: "text"

},

{

columnKey: "BarraId",

editorType: "text",

},

{

columnKey: "AltBarraId",

editorType: "text",

validation: true,

required: true,

}]

}

],

width: "900px",

height: '400px'

//dataSource: subs,

});

 

I set the grid to use the updateUrl: "Main.aspx/Update".  The method signature on the back end is the following.

[System.Web.Services.WebMethod(EnableSession = true)]

public static bool Update()

{

return true;

}

The method does not get called.  I am calling the saveChanges function but no server method gets called.   How do I use updating within aspx.

Thanks,

John

Parents Reply Children