Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
ScrolltoView enterEditMode
posted

I need to be able to scrolltoview and then put the cell in edit mode.  Here is my code.  if the cell is visible with out scrolling the cell is in edit mode if it has to scroll then not.

 

thanks 

 

if (val == "0" || val == "0.00") {

var editing = grid.get_behaviors().get_editingCore().get_behaviors().get_cellEditing();               

var firstCell = grid.get_rows().get_row(i).get_cell(0);

editing.enterEditMode(firstCell);

grid.get_rows().get_row(i).get_cell(0).scrollToView();

}

Parents
No Data
Reply
  • 15320
    Offline posted

    Hello mburk2,

    Thank you for posting in our community.

    If I understood your requirement right, I would suggest you to use two input text fields and one button at the bottom of the grid, which will serve for entering respectively the row and the cell value and on the button click the grid will scroll to view according to the entered row/cell values and the entedEditMode() method will be invoked for the current cell. For instance:

    function scrollToView() {

                var grid = $find("WebDataGrid1");

                var row = document.getElementById("row").value;

                var cell = document.getElementById("cell").value;

                var rowValue = parseInt(row);

                var cellValue = parseInt(cell);

                var currentCell = grid.get_rows().get_row(rowValue).get_cell(cellValue);

                currentCell.scrollToView();

                var editing = grid.get_behaviors().get_editingCore().get_behaviors().get_cellEditing();

                editing.enterEditMode(currentCell);

            }

    Attached is a sample with similar scenario for your reference.

    Please take a look at it and let me know if you have any further questions.

     

    Sincerely,

    Tsanna

    WDGScrollToViewEditing.zip
Children