开发者

jqGrid form edit stuck with initially loaded values

When I open form to edit values:

  1. It doesn't change form values when I navigate with <> buttons

  2. It opens New form with same values as first edited row, and when I click "Submit", it overwrites that row instead of creating a new item

  3. When I click to edit another row, it always shows the form values for the first edited row – i.e. if I click New first and then edit row, it shows empty form.

So, in short, the first time form opens, the values are "stuck" whatever row I open later.

What can cause this? I remember it used to work OK some time ago.

UPDATE:

No with recreateForm I don't have this issue (I use it as temporary workaround).

Hm, I can reproduce this on jqGrid example, but not on Live Manipulation - on New in Version 3.7, Add/edit/delete on local data:

  1. Click any row and edit it (open form)
  2. Cl开发者_StackOverflow社区ose form
  3. Select any other row and click edit - form shows incorrect values (from the row that was opened first)
  4. Click Add new row button in toolbar - form shows same values - which is very convenient, usually new rows are "almost" same - if only it would add new row, not update the existing one!

Of course in live demo Submit doesn't do that (it doesn't seem to work at all) but except for this symptoms are same.

Also <> buttons do not change data in form, though they change selected row - but from what I remember previously it used to update form values also to match selected row.


Probably you should post the description of your bug with "New in Version 3.7", "Add/edit/delete" as a bug in the in trirand forum.

The problem is that the bug exist in very special environment/data/settings. For example I tested my old local edit example modified to jqGrid 3.8.1 or in 3.7.2 and can not reproduce the problem which you describes. So you can use my examples as a template could it helps you.

Moreover in all examples which I use for real projects I use always parameter recreateForm:true. If you don't use it jqGrid not create a form, but try to use an existing with other data. It works in a lot of cases wrong. For example if you use any dataInit functions they will be called only once during creating of the form, which can make very strange affects. If you use edittype: 'custom' the usage of recreateForm:true is really mandatory (see this). So I recommended many times all people to use

jQuery.extend(jQuery.jgrid.edit, {recreateForm: true});

to set recreateForm: true as your default settings. You could save many hours or days of debugging of some strange effects in your edit/add dialogs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜