If I call a function to load my grid data, loadComplete does not fire. I need to handle this event so I can manually update multiselect checkbox correctly. If I update in gridComplete, I have to click the checkbox twice to uncheck it.
相关问题
- How to bind a dropdown list inside jqgrid row cell
- jQgrid filterToolbar fails with searchOnEnter
- Detecting checkbox event in jqGrid cell
- How to alter data received from the server before
- How to access other row data from a cell's cus
相关文章
- jqGrid Row Object in onSelectRow
- Weird behavior of jqgrid Grouping
- jQuery - jqGrid - submit buttons in each row
- JqGrid: sorting of local data
- How to Expand/Shrink row in Jqgrid dynamically
- VB.net FileUpload using Ajaxcall
- jqGrid addRowData doesn't work with grid as su
- How to turn off column highlighting (on hover) for
In your previous question you wrote that you use WCF on the server side. In the case you don't need to use
datatype
as function. Instead of that you can just use the following parameters:To be sure that
JSON.stringify
are supported in old web browsers you should includejson2.js
which you can load from here.In the old answer you can find more code examples (and download the demo) which shows how you can use WCF with jqGrid.
Now I will answer on your original question: "Why
loadComplete
does not fire" if you usedatatype
as function. The short answer is: if you usedatatype
as function your code is responsible for calling ofloadComplete
.If you use
datatype
as function your code is responsible to some things which jqGrid do typically. So first of all you have to understand what should thedatatype
function do. An example from the documentation (see here) shows the simplest, but not full, implementation ofdatatype
as function. More full code example looks like the following:You can see that the code in not so short. In the above example we still not support some jqGrid options like virtual scrolling (
scroll: 1
orscroll: true
).Nevertheless I hope that I cleared now why I don't recommend to use
datatype
as function. If you use it you have to understand many things how jqGrid work internally. You should examine it's source code to be sure that you do all things correctly. If you skip somethings, than your code will works incorrect in some situations or in some combination of jqGrid parameters.If you look at the code which I included at the beginning of my answer (the usage of
ajaxGridOptions
andserializeGridData
) you will see that the code is very easy. Moreover it works with all other legal combination of jqGrid parameters. For example you can useloadonce: true
,loadComplete
,loadError
or even virtual scrolling (scroll: 1
orscroll: true
). All things needed depend on the parameters do jqGrid for you.