MaintainScrollPositionOnPostback not working with javascript:\_\_doPostBack




 Hi i have gridView and records can be long. I have command field to update records. When i click "Edit" the command button makes javascript postback.  

JavaScriptCopy Code

```
javascript:\_\_doPostBack('gridSubCategories$ctl02$ctl00','');
```
  

Even i set MaintainScrollPositionOnPostback="true", after postback page is not scrolling previous point. What can i do?
Put the grid inside a panel (rather than scrolling the grid itself) and the following in the head section of the page. This is set for using a MasterPage, but you can remove the "ctl00\_MainContentPlaceHolder\_" prefix for a regular page.  

  

XMLCopy Code

```
<script type="text/javascript" language="javascript">
        window.onload = function () {
                var strCook = document.cookie;

                if (strCook.indexOf("!~") != 0) {
                        var intS = strCook.indexOf("!~");
                        var intE = strCook.indexOf("~!");
                        var strPos = strCook.substring(intS + 2, intE);
                        document.getElementById("ctl00\_MainContentPlaceHolder\_pnlFindings").scrollTop = strPos;
                }

        }
</script>
<script type="text/javascript" language="javascript">
        function SetDivPosition() {
                var intY = document.getElementById("ctl00\_MainContentPlaceHolder\_pnlFindings").scrollTop;
                document.cookie = "yPos=!~" + intY + "~!";
        }
</script>
```
  

  

In the Panel, you'll need:   

 onscroll="SetDivPosition()"  

  

That should do it for you. Works for me, anyway.
You can use SetCursorPos() to control the position of the cursor. It returns true is it succeeds and false if not. It takes 2 arguments int x and int y. You can use GetCursorPos() to retrieve the position of cursor. it returns the same as Set...() it takes one paramater a pointer to a structure of type POINT, which contains to values long x and long y. Also if you want to send Mouse clicks then you will need to look into the function SendInput() its well documented on msdn but feel free to ask for more information.



Chris hi larry, - - thank you for writing. - - to disable the arrow keys you need to override the onkeydown method:  - - class mypageview : radpageview - { -     protected override void onkeydown(keyeventargs e) -     { -         if (e.keycode == keys.left || e.keycode == keys.right) -         { -             return; -         } -         base.onkeydown(e); -     } - } - - - i hope this information is useful. let me know if you need further assistance. - - regards, - dimitar - telerik by progress - - try our brand new, jquery-free angular 2 components built from ground-up which - deliver the business app essential building blocks - a grid component, - data visualization (charts) and form elements. - hey [@jsteb](/u/jsteb), i was struggling with this and i figured what is going on. the problem is with the action button. if you try with a regular button it will work. i think that should be clarified in the tutorial May be the function is executed before the document is ready.
Try to use document.ready function like this:



```
$( document ).ready(function() {
    $('#machines').change(function() {
        var $selected = $(this).find(':selected');
        $('#description').html($selected.data('description'));
    }).trigger('change');
});

``` i do not write go, but it seems like your

func(w http.responsewriter

should be similar to

responsewriter.header().set("content-type", "application/json")

responsewriter.writeheader(http.statusok)

jsondata := []byte(`{}`)

responsewriter.write(jsondata) I have figured out this issue and so for anyone else with the same issue.

In Designer for your XDP make sure you have a subform as the entry for the table row, and make this subform "Repeat Subform for Each Data Item" I found the subform could not be within another subform for this option to be visible.

So after this you can assign the row to the subform and the elements to the elements within the subform and hopefully it'll work.




[View solution in original post](/t5/adobe-experience-manager-forms/dynamic-rows-in-a-table-issue-also-relates-to-having-elements/m-p/204725#M6246) Presumably the Save button will already have the focus, so why not just use SendKeys


SendKeys "{Enter}"


HTH,  

Rob for example, you can disable right click on images at your page:

```

$(document).ready(function() {
    $("img").on("contextmenu",function(){
       return false;
    }); 
}); 

``` I was able to resolve this thanks to the mental knock from Panagiotis Kanavos. I started simplifying my query to be able to post it and realized that I had placed the RowVersion column in the incorrect place of my select statement so it was being sent to `AnotherObject` instead of MyObject


Thanks for that. [image] bryan:

you will need to hunt through the page and find the raw html dom object.

thank you. but i guess, it’s impossible to open select widget.

callback = customjs(args=dict(select\_=select),code="""

var el = document.getelementsbyname(select\_.name)[0];

…