POLALA.COM
welcome to my space
X
Search:  
Web Design | Video Games | RVs | Religion | Management | Supplements and Vitamins | Software | Basketball | Related articles
Welcome to:polala.com
NAVIGATION: Home >>

[SOLVED] How define navigation limits in a grid

Published by: jane 2009-01-09

  • Hi
    I have a grid that is navigated with the arrow keys
    I need to define the first and the last column as the limits, this means that when I reach through the keys the last column, and then I press right arrow again, I don't want to jump to the first column, and on the other hand, when I reach the first column, I don't want to jump to the last one.
    NAVIGATION DEPENDENT NONLINEAR DEPTH SCALING Ingo Feldmann, Ulrich ::
    File Format: PDF/Adobe AcrobatBecause usually dispar-. ities are estimated within the pixel sampling grid the image. resolution and the camera distance define the positions of
    http://iphome.hhi.de/feldmann/pdfs/FGK03.pdf
    HOME

    Do you know how could I do this?


  • To clarify: You are using an Ext.grid.CellSelectionModel and when you press the left/right keys you do not want to go the previous/next row when you go past the first/last cell?
    ->Yes, this is correct.

    This behavior is implemented in GridPanel's walkCells private method. I think you will have to override this method to get what you are looking for.

    Hooking onto the beforecellselect event will not work because the event does not provide you any information about the previously selected cell.
    ->Well currently i hook via the "keypress" method. Here we have all necessary information. But main problem is that we are not able to stop the cursor at the end of the row.
    Can you give me please a short example how to overwrite the walkCells private method?


  • Thanks for your reply!
    I modified it a little bit, because the user could hide some columns, therefore I need to get the first and the last not hidden columns.


    Ext.override(Ext.grid.GridPanel, {
    walkCells : function(row, col, step, fn, scope){
    var cm = this.colModel, clen = cm.getColumnCount();
    var ds = this.store, rlen = ds.getCount(), first = true;
    var firstColumnIndex,lastColumnIndex;
    for(i=0;i<=clen-1;i++){
    if(cm.getColumnById(cm.getDataIndex(i)).hidden!=tr ue && firstColumnIndex==undefined){
    firstColumnIndex=cm.getIndexById(cm.getColumnId(i) );//here we get the first not hidden column
    }

    if(cm.getColumnById(cm.getDataIndex(i)).hidden!=tr ue){
    lastColumnIndex=cm.getIndexById(cm.getColumnId(i)) ;//here we get the last not hidden column
    }
    }
    lastColumnIndex=lastColumnIndex+1;
    if(step < 0){//when the user press left arrow
    if(col < firstColumnIndex){
    //row--;
    //first = false;
    return [row, firstColumnIndex];
    }
    while(row >= 0){
    if(!first){
    col = clen-1;
    }
    first = false;
    while(col >= 0){
    if(fn.call(scope this, row, col, cm) === true){
    return [row, col];
    }
    col--;
    }
    row--;
    }
    } else {
    if(col >= lastColumnIndex){
    //row++;
    //first = false;
    return [row, col-1];
    }
    while(row < rlen){
    if(!first){
    col = 0;
    }
    first = false;
    while(col < clen){
    if(fn.call(scope this, row, col, cm) === true){
    return [row, col];
    }
    col++;
    }
    row++;
    }
    }
    return null;
    }
    });


  • Ext.override(Ext.grid.GridPanel, {
    walkCells : function(row, col, step, fn, scope){
    var cm = this.colModel, clen = cm.getColumnCount();
    var ds = this.store, rlen = ds.getCount(), first = true;
    if(step < 0){
    if(col < 0){
    //row--;
    //first = false;
    return [row, 0];
    }
    while(row >= 0){
    if(!first){
    col = clen-1;
    }
    first = false;
    while(col >= 0){
    if(fn.call(scope this, row, col, cm) === true){
    return [row, col];
    }
    col--;
    }
    row--;
    }
    } else {
    if(col >= clen){
    //row++;
    //first = false;
    return [row, col-1];
    }
    while(row < rlen){
    if(!first){
    col = 0;
    }
    first = false;
    while(col < clen){
    if(fn.call(scope this, row, col, cm) === true){
    return [row, col];
    }
    col++;
    }
    row++;
    }
    }
    return null;
    }
    });


  • To clarify: You are using an Ext.grid.CellSelectionModel and when you press the left/right keys you do not want to go the previous/next row when you go past the first/last cell?

    This behavior is implemented in GridPanel's walkCells private method. I think you will have to override this method to get what you are looking for.

    Hooking onto the beforecellselect event will not work because the event does not provide you any information about the previously selected cell.





  • Where's The Advantage In Windows Genuine Advantage?
    Stocks Bounce After S&P Joins Bear Market

    PRINT Add to favorites
  • solved pagingtoolbar data loaded but paging not working
  • masking
  • ext example msg slidein and scrolling
  • jsonstore loading
  • solved anchor layout problem
  • possible accordion within tabpanel
  • adding components to an existing panel at runtime
  • editorgrid auto edit on keypress select cell content
  • tutorial introduction issue with rails 2
  • memoryproxy and combobox
  • how to keep a blank value in combo where values are returned from an xml file
  • 2 bug in image organizer example
  • how to make tbar in the gridpanel dynamically by json

  • blocking right click from selecting node in tree
  • checkbox refusing to save state
  • complex grid cell configuration with multi rows
  • treepanel add clickable image after each item
  • form submission questions
  • on click event for a group of elements
  • what is cdata needed for
  • multi column forms
  • drag and drop to htmleditor
  • rownumberer is not updating once i remove add records
  • table layout to full width
  • how to auto select a combobox or auto checked a checkbox while form edit
  • determine ctrl key wuth d d
  • newbie problem messagebox parameters
  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about [SOLVED] How define navigation limits in a grid , Please add it free.

    About us -Site map -Advertisement -Jion us -Contact usExchange linksSponsor us
    Copyright© 2008 polala.com All Rights Reserved
    Site made&Support support@polala.com    E-mail: web@polala.com