Note that there are some explanatory texts on larger screens.

plurals
  1. POeditURL not being called - JQGrid
    primarykey
    data
    text
    <p>I have an editable jqGrid, inline editing with events, but the EditURL is not being called. Edit Data is a web method in vb.net. When I click on a row the row becomes editable and I am able to make changes but when I hit enter the EditURL is not being called. Please suggest any changes necessary.</p> <pre><code>&lt;ScriptMethod(ResponseFormat:=ResponseFormat.Json)&gt; _ &lt;WebMethod()&gt; _ Public Shared Function LoadData() As jqGridResult 'If MuList.SelectedValue &lt;&gt; "0" AndAlso MuList.SelectedValue &lt;&gt; String.Empty Then ' hirNodeMu = hirNodeMu.Parse(MuList.SelectedValue) 'Else ' hirNodeMu = 0 'End If 'Dim hirNode As Integer = hirNodeMu 'If hirNode = 0 Then ' hirNode = hirNodeCurrent 'End If Dim sidx As String = "" Dim sord As String = "asc" Dim page As Integer = 1 Dim rows As Integer = 1000 Dim entryFieldsOnly As Integer = 1 Dim hirNode As Integer = 5 Dim fiscalYear As Integer = 2012 Dim fiscalPeriod As Integer = 3 Dim dtWORData As DataTable = New DataTable() Dim ConnectString As String = ConfigurationSettings.AppSettings("DbConnection") Using sqlConnection As New SqlConnection(ConnectString) Dim Conn As SqlConnection = New SqlConnection(ConnectString) Dim Cmd As SqlCommand = New SqlCommand("finWorFactView", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@hirNodeBase", SqlDbType.Int, 4).Value = hirNode Cmd.Parameters.Add("@FiscalYear", SqlDbType.Int, 4).Value = fiscalYear Cmd.Parameters.Add("@FiscalPeriod", SqlDbType.Int, 4).Value = fiscalPeriod Cmd.Parameters.Add("@EntryFieldsOnly", SqlDbType.Int, 4).Value = entryFieldsOnly Conn.Open() Dim DA As SqlDataAdapter = New SqlDataAdapter(Cmd) DA.Fill(dtWORData) End Using Dim pageIndex As Integer = page Dim pageSize As Integer = rows Dim startRow As Integer = (pageIndex * pageSize) + 1 Dim totalRecords As Integer = dtWORData.Rows.Count() Dim totalPages As Integer = CInt(Math.Ceiling(CSng(totalRecords) / CSng(pageSize))) Dim row As List(Of jqGridRows) = New List(Of jqGridRows) For i As Integer = 0 To dtWORData.Rows.Count - 1 Dim newRow As jqGridRows = New jqGridRows newRow.id = Convert.ToInt32(dtWORData.Rows(i)("DisplayOrder")) newRow.cell(0) = dtWORData.Rows(i)("DisplayOrder").ToString() newRow.cell(1) = dtWORData.Rows(i)("ColumnPosition").ToString() newRow.cell(2) = dtWORData.Rows(i)("ColumnName").ToString() newRow.cell(3) = dtWORData.Rows(i)("Week1").ToString() newRow.cell(4) = dtWORData.Rows(i)("Week2").ToString() newRow.cell(5) = dtWORData.Rows(i)("Week3").ToString() newRow.cell(6) = dtWORData.Rows(i)("Week4").ToString() newRow.cell(7) = dtWORData.Rows(i)("Week5").ToString() newRow.cell(8) = dtWORData.Rows(i)("DbFieldName").ToString() newRow.cell(9) = dtWORData.Rows(i)("Updateable").ToString() newRow.cell(10) = dtWORData.Rows(i)("PayrollActive").ToString() newRow.cell(11) = dtWORData.Rows(i)("PurchasingActive").ToString() newRow.cell(12) = dtWORData.Rows(i)("hirNode").ToString() newRow.cell(13) = dtWORData.Rows(i)("finWor1").ToString() newRow.cell(14) = dtWORData.Rows(i)("finWor2").ToString() newRow.cell(15) = dtWORData.Rows(i)("finWor3").ToString() newRow.cell(16) = dtWORData.Rows(i)("finWor4").ToString() newRow.cell(17) = dtWORData.Rows(i)("finWor5").ToString() newRow.cell(18) = dtWORData.Rows(i)("finWorP").ToString() newRow.cell(19) = dtWORData.Rows(i)("Total").ToString() newRow.cell(20) = dtWORData.Rows(i)("Projection").ToString() newRow.cell(21) = dtWORData.Rows(i)("HealthCareActive").ToString() row.Add(newRow) Next Dim result As jqGridResult = New jqGridResult result.total = totalPages result.page = page result.records = totalRecords result.rows = row Return result End Function &lt;ScriptMethod(ResponseFormat:=ResponseFormat.Json)&gt; _ &lt;WebMethod()&gt; _ Public Shared Function EditData(ByVal Week1 As String, ByVal Week2 As String, ByVal Week3 As String, ByVal Week4 As String, _ ByVal Week5 As String, ByVal Projection As String, _ ByVal DbFieldName As String, ByVal hirNode As String, _ ByVal FinWor1 As String, ByVal FinWor2 As String, ByVal FinWor3 As String, ByVal FinWor4 As String, _ ByVal FinWor5 As String, ByVal FinWorP As String, ByVal HealthCareActive As String, _ ByVal oper As String, ByVal id As String) As Boolean Dim objClass As New _Default objClass.LogError(Week1 + " " + Week2 + " " + Week3 + " " + Week4 + " " + Week5 + " " + Projection) Return True End Function </code></pre> <p>This is from firebug - the request body Week1=+767%2C077+&amp;Week2=+727%2C055+&amp;Week3=+719%2C411+&amp;Week4=+738%2C102+&amp;Week5=+290%2C921+&amp;Projection=False&amp;DbFieldName=False&amp;hirNode=&amp;FinWor1=&amp;FinWor2=&amp;FinWor3=&amp;FinWor4=&amp;FinWor5=+3%2C242%2C566+&amp;FinWorP=+2%2C869%2C267+&amp;HealthCareActive=False&amp;oper=edit&amp;id=14</p> <p>Js Code</p> <pre><code>jQuery(document).ready(function($) { var lastsel; $(document).ready(function() { loadGrid(); }); function loadGrid() { jQuery("#tblWOR").jqGrid({ url: 'Default.aspx/LoadData', mtype: 'POST', datatype: 'json', ajaxGridOptions: { contentType: 'application/json; charset=utf-8' }, serializeGridData: function(postData) { return JSON.stringify(postData); }, rowNum: 1000, width: 1200, height: 'auto', colNames: ['Display Order', 'Column P', 'Column N', 'Week1(1-7)', 'Week2(8-14)', 'Week2(15-21)', 'Week1(22-28)', 'Week1(29-31)', 'Total Month' + '&lt;/br&gt;' + 'to Date', 'Projection' + '&lt;/br&gt;' + 'for Month', 'DbFieldName', 'Updateable', 'PayrollActive', 'PurchasingActive', 'hirNode', 'WOR1', 'WOR2', 'WOR3', 'WOR4', 'WOR5', 'WORP', 'HealthCareActive', ], colModel: [ { name: 'DisplayOrder', index: 'DisplayOrder', hidden: true }, { name: 'CoulumnPosition', index: 'Week1', width: 55 }, { name: 'ColumnName', index: 'Week1', width: 80 }, { name: 'Week1', index: 'Week1', width: 55, editable: true, edittype: 'text' }, { name: 'Week2', index: 'Week2', width: 55, editable: false, edittype: 'text' }, { name: 'Week3', index: 'Week3', width: 55, editable: false, edittype: 'text' }, { name: 'Week4', index: 'Week4', width: 55, editable: false, edittype: 'text' }, { name: 'Week5', index: 'Week5', width: 55, editable: false, edittype: 'text' }, { name: 'Total', index: 'Total', width: 55 }, { name: 'Projection', index: 'Projection', width: 55, editable: false, edittype: 'text' }, { name: 'DbFieldName', index: 'DbFieldName', editable: false, hidden: true }, { name: 'Updateable', index: 'Updateable', editable: false, hidden: true }, { name: 'PayrollActive', index: 'PayrollActive', editable: false, hidden: true }, { name: 'PurchasingActive', index: 'PurchasingActive', editable: false, hidden: true }, { name: 'hirNode', index: 'hirNode', editable: false, hidden: true }, { name: 'FinWor1', index: 'FinWor1', editable: false, hidden: true }, { name: 'FinWor2', index: 'FinWor2', editable: false, hidden: true }, { name: 'FinWor3', index: 'FinWor3', editable: false, hidden: true }, { name: 'FinWor4', index: 'FinWor4', editable: false, hidden: true }, { name: 'FinWor5', index: 'FinWor5', editable: false, hidden: true }, { name: 'FinWorP', index: 'FinWorP', editable: false, hidden: true }, { name: 'HealthCareActive', index: 'HealthCareActive', editable: false, hidden: true } ], pager: '#divWOR', jsonReader: { root: "d.rows", page: "d.page", total: "d.total", records: "d.records", repeatitems: false }, sortname: 'DisplayOrder', viewrecords: true, sortorder: "asc", onSelectRow: function(DisplayOrder) { if (DisplayOrder &amp;&amp; DisplayOrder !== lastsel) { jQuery('#tblWOR').jqGrid('restoreRow', lastsel); jQuery('#tblWOR').jqGrid('editRow', DisplayOrder, true); lastsel = DisplayOrder; } }, cellsubmit: 'remote', editurl: "Default.aspx/EditData", caption: "WOR View Grid" }); jQuery("#tblWOR").jqGrid('navGrid', "#divWOR", { edit: false, add: false, del: false }); } </code></pre> <p>});</p> <p>I am able to debug my code. The data is being returned by the web method but not being displayed in the grid.</p> <p>This is the data I am getting.. (I am showing just one row since the data was big)</p> <pre> {"d":{"__type":"LearnEveryday._Default+jqGridResult","total":1,"page":1,"records":25,"rows":[{"id":3,"cell":["3","2","JWO Revenue"," 921,300 "," 899,595 "," 912,983 "," 941,659 "," 805,100 ","RevenueJwo","False","False","False","0","","","","","",""," 4,480,637 "," 5,378,594 ","False",null]}} </pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload