Note that there are some explanatory texts on larger screens.

plurals
  1. POjqGrid loadComplete fires before data filled grid - sum function show previously values
    primarykey
    data
    text
    <p>I have a problem. LoadComplete fire before data are passed to grid.</p> <p>I have this form: <img src="https://i.stack.imgur.com/tLpF6.png" alt="enter image description here"></p> <p>I pass new row data by jquery Post to server. And refresh grid by </p> <pre><code>$('#grid').trigger("reloadGrid"); </code></pre> <p>After that event throw and run this function <code>alert($('#grid').jqGrid('getCol', 'Unit', false, 'sum');)</code> show the previosly values (Values actual BEFORE I added a item). So If I have two rows, where values is</p> <p><img src="https://i.stack.imgur.com/AZBgX.png" alt="enter image description here"></p> <p>And I added third value - 1. And popup show <strong>2</strong>, but expected <strong>3</strong>. If I delete row I have the same problem My grid:</p> <pre><code>jQuery("#grid").jqGrid({ caption: 'Timesheet', url:'/GetData', editUrl: '/EditRow' datatype: "json", colNames: ['Id','Start Time', 'End Time', 'Unit'], colModel: [ { name: 'Id', index: 'Id' }, { name: 'StartTime', index: 'StartTime' }, { name: 'EndTime', index: 'EndTime' }, { name: 'Unit', index: 'Unit' } ], rowNum:10, rowList:[10,20,30], pager: '#pager2', sortname: 'id', viewrecords: true, sortorder: "desc", postData: { entityId: function () { return $('#GetId').val(); }, loadComplete: function (data) { **alert($('#grid').jqGrid('getCol', 'Unit', false, 'sum');)** } }); jQuery("#grid").jqGrid('navGrid','#pager2',{edit:false,add:true,del:false}); </code></pre> <p>Added example. <a href="http://jsfiddle.net/5bmVt/1/" rel="nofollow noreferrer">http://jsfiddle.net/5bmVt/1/</a></p> <p>EDITED. Modified example <a href="http://jsfiddle.net/SUvvW/1/" rel="nofollow noreferrer">http://jsfiddle.net/SUvvW/1/</a></p>
    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.
    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