刷新整个页面jqGrid分页 [英] Refreshing entire page jqGrid paging

查看:84
本文介绍了刷新整个页面jqGrid分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户双击我页面上的一行时,我将他们导航到一个编辑屏幕,其中显示了一些重要信息.当他们提交该患者时,我gerimander jqGrid会将他们带到他们刚刚查看的页面...

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

我基本上在serializeGridData函数中编辑了postData.

我的问题是,当我编辑完信息并返回到正确的页面后,当我单击整个页面的刷新时,导航至另一个页面时,请说10之3.

我希望用户返回到他们刚刚导航到的页面.现在,它将使他们返回到编辑信息后最初返回的页面.因此,如果我要构建事件的时间表...

1)用户看到的分页信息... 2)用户选择要编辑的行 3)用户导航到编辑页面,然后做他的事情然后提交 4)用户现在被发送回他来自的页面... 5)用户转到另一个页面(下一个或最后一个) 6)用户刷新页面 7)!!从第3步和第4步(而不是第5步)将用户发送到X页!

我希望刷新页面事件并在那里设置正确的页面.
我的方法论或思想在这里正确吗?无论如何,有没有办法确保选择正确的页面?

我刚刚再次检查.看来,如果用户 1)导航至第X页 3)刷新页面

他将被发送至第1页.

也许我正在设定一个不切实际的期望.也许如果他们重新加载整个页面,他们应该会回到第1页.

即使如此,我如何在第一个工作流程中完成该任务

解决方案

在我看来,您遇到的真正问题是步骤3的用法:用户导航到编辑页面并执行其操作,然后提交".该步骤将解决您尝试解决的所有问题.可以不用动态地创建另一页面,而是可以动态创建一些允许编辑所选行的控件. jqGrid提供内联编辑 navGrid inlineNav )或网格的附加列(请参见formatter: "actions").

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

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

解决方案

In my opinion the real problem which you have is the usage of step 3: "user navigates to edit page and does his thing then submits". The step makes all the problems which you try to solve. Instead of going to another page one can create dynamically some controls which allows to edit the selected row. jqGrid provide inline editing or form editing for the purpose. You need just include editable: true property in the columns which you need to edit implement starting of inline/form editing on select of row or on double click. Alternatively you can use buttons from the navigator bar (see navGrid and inlineNav) or in addition column of the grid (see formatter: "actions").

If you still don't want to use any editing mode which provide jqGrid you can just place the whole content of the body of the main page inside of a div. You can hide the div using jQuery.hide instead of redirection to "edit page". You can load the content of "edit page" on the same main page (per jQuery.load for example). Then you can remove the loaded "edit page" and show the original main page. As the result the main page will be shown in exactly the same form as it was before starting of editing.

这篇关于刷新整个页面jqGrid分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆