-1

When a user double clicks on a row on my page, I navigate them to an edit screen which shows them some important information. When they submit that patient I gerimander jqGrid to take them page to the page that they were just viewing...

            serializeGridData: function (postData) {
                //debugger;
                var pagInfo = $(this).se
                debugger;
                if ((rowFromTemp != "") && (pageFromTemp != "")) {
                    //debugger;
                    postData.page = pageFromTemp;
                    pageFromTemp = "";
                    rowFromTemp = "";                        
                }
                return postData;
            },

I basically edited the postData in the serializeGridData function.

My question is, when I navigate to a different page lets say page 3 of 10 after I have edited information and returned to the correct page, when I click refresh of the whole page...

I want the user to return to the page that they just navigated to. Right now, it will return them back to the page that they initially returned from after editing information. So If I were to construct a timeline of events...

1) user see's paged information... 2) user selects row to edit 3) user navigates to edit page and does his thing then submits 4) user now is sent back to page where he came from... 5) user goes to a different page (either next or last) 6) user refreshes page 7) !! user is sent to page X from step 3 and 4 and Not 5 !!

I was hoping to to some kind of refresh of page event and set the correct page in there.
Is my methodology or thinking in correct here? Is there a way to ensure that the correct page is selected no matter what?

I just checked again. It would seem that if a user 1) navigates to page X 3) refreshes a page

he will be sent to page 1.

Maybe I am setting an unrealistic expectation. Maybe if they reload the whole page, they should expect to go back to page 1.

Well even so, how could I accomplish that task with the first workflow enter image description here

4

1 回答 1

1

在我看来,您遇到的真正问题是第 3 步的使用:“用户导航到编辑页面并做他的事情然后提交”。该步骤使您尝试解决的所有问题。无需转到另一页,您可以动态创建一些允许编辑所选行的控件。jqGrid 为此目的提供内联编辑表单编辑。您只需editable: true在需要编辑的列中包含属性即可在选择行或双击时实现内联/表单编辑的开始。或者,您可以使用导航栏中的按钮(请参阅navGridinlineNav)或网格的其他列(请参阅formatter: "actions")。

如果您仍然不想使用任何提供 jqGrid 的编辑模式,您可以将主页正文的全部内容放在 div 中。您可以使用 jQuery.hide 隐藏 div,而不是重定向到“编辑页面”。您可以在同一主页上加载“编辑页面”的内容(例如每个 jQuery.load)。然后您可以删除加载的“编辑页面”并显示原始主页。结果,主页将以与开始编辑之前完全相同的形式显示。

于 2013-03-05T19:20:53.260 回答