Refreshing entire page jqGrid paging
Asked Answered
X

1

-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

Xylia answered 5/3, 2013 at 16:53 Comment(0)
D
1

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.

Dower answered 5/3, 2013 at 19:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.