1. #1
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default 1) Edit and Select with EditorGrid. 2) Detect sorts in serve

    1) Edit and Select with EditorGrid. 2) Detect sorts in serve


    1) In a EditorGrid i want:

    1) On one click select row.

    2) On double click edit row.

    I define:

    selectionModel = new YAHOO.ext.grid.SingleSelectionModel();
    selectionModel.addListener('selectionchange', onSelection);

    Work in normal grid (new YAHOO.ext.grid.Grid), but not work with editorgrid (new YAHOO.ext.grid.EditorGrid):

    Any Idea?

    2) How to detect in my server script that "sortColumn" and/or "sortDir" has changed for avoid the sort?? Can I check in client?

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    1) There is a EditorAndSelectionModel in the the latest build (0.32.3.1) that does what you want.

    2) I depends on your model, your script, etc. Why do you need to detect whether a sort is needed? Generally the grid only requests a sort when it is needed.

  3. #3
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default Thanks jack for your reply

    Thanks jack for your reply


    Hi Jack,

    Te responderé en castellano porque me explico mejor.

    Mi script de servidor hace una consulta y ordena los resultados siempre. Hay veces que no sería necesario ordenar, por ejemplo en la paginación, cuando avanzo una página y no he ordenado por ninguna columna quiero indicarle a mi script de servidor que no es necesario ordenar.

    En definitiva, necesito que mi script de servidor además de los paramMaps "sortColumn" y "sortDir" tenga los "sortColumn" y "sortDir" antiguos para poder compararlos en el servidor y ordenar o no.

    No utilizo SQL en el servidor porque trabajo contra Lotus Notes (BD no relacionales). Tengo que leer de una vista y ordenar los resultados con Quicksort. Con 5000 elementos me tarda 13 segundos. ¿Se te ocurre algo?

    Por otra parte, ¿Como funciona EditorAndSelectionModel? Si cambio


    Code:
            grid = new YAHOO.ext.grid.EditorGrid('editor-grid', dataModel, colModel);
        	 grid.getSelectionModel().clicksToActivateCell = 2;
          	 grid.render();

    Por :

    Code:
            grid = new YAHOO.ext.grid.EditorAndSelectionModel('editor-grid', dataModel, colModel);
        	 grid.getSelectionModel().clicksToActivateCell = 2;
          	 grid.render();
    Me da errores!!!

    Un saludo,

  4. #4
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    Entiendo perfecto. No puedo explicarlo en espanol, pero eso, explico en ingles - esta bien?

    From what you are saying, I am assuming you are storing the sorted results on the server in some kind of structure? A session? If you are, you could also store the current sort values (sortColumn and sortDir) in the same session store and then compare the incoming request's sortColumn and sortDir with the last sortColumn and sortDir and determine if a sort is necessary. That is the easiest way to do it.

    Si no sirve eso - dimelo - y podemos buscar otra manera de hacerlo en DataModel.

    Jack

Similar Threads

  1. Detect collapse state
    By heidtmare in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 19 Sep 2007, 6:33 PM
  2. Possible to rectangular select marquee for multiple select?
    By ryes540 in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 15 Mar 2007, 12:18 PM
  3. Detect moment data grid is complete loaded
    By fnan11 in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 10 Mar 2007, 12:09 PM
  4. EditorGrid - Pressing alphabet on NumberField starts edit
    By mystix in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 28 Feb 2007, 9:29 AM
  5. Detect when document is completly loaded (even images)
    By pbrosset in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 1 Dec 2006, 6:08 AM

Thread Participants: 1