[CLOSED] Row Editor issue with Checkbox selection model

  1. #1

    [CLOSED] Row Editor issue with Checkbox selection model

    Hi,

    I need to implement some functionality which one allow to Edit row and also select multiple rows to delete. I have added checkbox selection model which will allow to select multiple records for delete, at the same time if I want to edit row it should allow to edit, so I have added row editor plugin.

    <ext:RowEditor ID="RowEditor1" runat="server" SaveText="Update" ClicksToEdit="2">
         <Listeners>
         <AfterEdit Fn="AfterEditTaskRow"></AfterEdit>
         </Listeners>
         </ext:RowEditor>
    I have added ClicksToEdit="2", while doing double click, this row checkbox is become uncheck and row editor is showing. It is not updating any info even after clicking on Update, because while doing update I am verifying the selected row, I am getting selected count=0, because no row get selected.
    Dim sm As RowSelectionModel = TryCast(Me.gvTaskReg.SelectionModel.Primary, RowSelectionModel)
    If I have implement ClicksToEdit="1" instead of ClicksToEdit="2", the row editor is always showing and it is not allowing to do other functionality in the row, means any commands added to row will not work. So how to achieve my requirement?
    Last edited by Daniil; Dec 12, 2011 at 2:54 PM. Reason: [CLOSED]
  2. #2
  3. #3
    Hi Daniil,

    It is working fine if you select only checkbox. If any commands existed in the row to open popup window for specific row info, and if we trying to click on command it is opening popup window as well as row editor. The row editor should not show if we click on any command. So how to restrict it? otherwise I just need something like whenever you double click on row it should open row editor and the row checkbox should always select.


    Quote Originally Posted by Daniil View Post
  4. #4
    What commands do you use - ImageCommand, GridCommand?

    Generally, you should add respective targets to the RowClick and RowDblClick listeners:
    <RowClick Handler="return !e.getTarget('.x-grid3-td-checker');" />
    <RowDblClick Handler="return !e.getTarget('.x-grid3-td-checker');" />
    Last edited by Daniil; Dec 07, 2011 at 2:49 PM.
  5. #5
    Quote Originally Posted by rnachman View Post
    otherwise I just need something like whenever you double click on row it should open row editor and the row checkbox should always select.
    Well, CheckboxSelectionModel handles the MouseDown event, it means that selecting occurs on each mouse click.

    I would suggest to set up the checkOnly config option to true.
    http://docs.sencha.com/ext-js/3-4/#!/api/Ext.grid.CheckboxSelectionModel-cfg-checkOnly
  6. #6
    Hi Daniil,

    I am using GridCommand. I did following modification. but it is not working...
    <RowClick Handler="return !e.getTarget('.x-grid3-td-gridcommand');" />
    Quote Originally Posted by Daniil View Post
    What commands do you use - ImageCommand, GridCommand?

    Generally, you should add respective targets to the RowClick and RowDblClick listeners:
    <RowClick Handler="return !e.getTarget('.x-grid3-td-checker');" />
    <RowDblClick Handler="return !e.getTarget('.x-grid3-td-checker');" />
  7. #7
    There is no ".x-grid3-td-gridcommand" class. You should inspect html elements to determine a correct selector.

    Please try:
    <RowClick Handler="return !e.getTarget('.x-btn');" />
  8. #8
    Hi Daniil,

    The checkbox got checked only if we check the checkbox for this CheckOnly="true" property. I need this checkbox should always check whether single click or double click on the row for editing. If I implement ClicksToEdit="1" then for single click the row editor is showing and checkbox got checked, then I have cancel the update, still the checkbox got checked, it should uncheck either update or cancel the row edit information. If I have implement ClicksToEdit="2" the checkbox is never selecting, so that the updation of modified record is not working.

    Quote Originally Posted by Daniil View Post
    Well, CheckboxSelectionModel handles the MouseDown event, it means that selecting occurs on each mouse click.

    I would suggest to set up the checkOnly config option to true.
    http://docs.sencha.com/ext-js/3-4/#!/api/Ext.grid.CheckboxSelectionModel-cfg-checkOnly
  9. #9
    Well, there is no such built-in functionality, so. you should implement it manually.

    Example
    <ext:RowEditor runat="server" ClicksToEdit="1">
        <Listeners>
            <AfterEdit Handler="GridPanel1.getSelectionModel().deselectRow(rowIndex);" />
            <CancelEdit Handler="GridPanel1.getSelectionModel().deselectRow(this.grid.getStore().indexOf(this.record));" />
        </Listeners>
    </ext:RowEditor>

Similar Threads

  1. [CLOSED] CheckBox Selection Model & Row Editor Plugin
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 02, 2012, 6:16 AM
  2. Replies: 2
    Last Post: Aug 09, 2011, 10:38 AM
  3. [CLOSED] checkbox selection model
    By majestic in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 24, 2010, 1:22 PM
  4. Replies: 4
    Last Post: Oct 06, 2010, 9:08 AM
  5. Checkbox selection model + getRowsValues
    By Birgit in forum 1.x Help
    Replies: 10
    Last Post: Sep 06, 2010, 5:12 PM

Tags for this Thread

Posting Permissions