[CLOSED] GridPanel: ServerSide Code Equivalent for "getSelectionModel().selectRow(0)" and "getView().focusRow(0)"

  1. #1

    [CLOSED] GridPanel: ServerSide Code Equivalent for "getSelectionModel().selectRow(0)" and "getView().focusRow(0)"

    Hi,

    I am trying to select the first record if there are nothing selected in the GridPanel.

    In the client-side, my code is:
    grid.getSelectionModel().selectRow(0);
    grid.getView().focusRow(0);
    But can you advice the server side equivalent of this?

    Thanks, J
    Last edited by Daniil; Oct 11, 2011 at 8:22 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please clarify do you need these actions during DirectEvent?

    If yes, please use:

    1. To select a row, please use:
    (GridPanel1.GetSelectionModel() as RowSelectionModel).SelectRow(0);
    or just
    RowSelectionModel1.SelectRow(0);
    2. A selected row should be focused, but here is the code to focus a row:
    GridPanel1.GetView().FocusRow(0);
    or just
    GridView1.FocusRow(0);
  3. #3
    Hi Daniil,

    Actually its on the first load.

    Now:
    (1) [server] Script will open a ext.window
    (2) [server] A GridPanel will be created in this window
    (3) [client] the first row will be selected.
    (4) [client] the value of this gridpanel will be sent back to server via DirectMethod
    (5) [server] another GridPanel will be populated based on this value.

    I am trying to:
    (1) [server] Script will open a ext.window
    (2) [server] A GridPanel will be created in this window
    (3) [server] select the first value and populate the 2nd GridPanel

    but somehow I am getting "this.grid.store" is null error. Is it possible to do what I am trying to do (I suspect the error is caused by the html not yet being created when the row is selected)?
  4. #4
    Please use ViewReady listener of the GridPanel:
    GridPanel1.Listeners.ViewReady.Handler = "this.getSelectionModel().selectRow(0);"
  5. #5
    Thanks Daniil,

    Please close this ticket.

    Regards, J

Similar Threads

  1. [CLOSED] How does "MaskCls" work for "AutoLoad" mask in panel control
    By leon_tang in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 19, 2012, 12:09 PM
  2. Replies: 1
    Last Post: Jun 26, 2012, 11:29 AM
  3. [CLOSED] Hidden="true" behaves as Visible="false"
    By marco.morreale in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: May 28, 2012, 3:17 PM
  4. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  5. Replies: 2
    Last Post: Jun 26, 2011, 1:59 AM

Posting Permissions