PDA

View Full Version : [CLOSED] V2.0 beta RowEditing & ClicksToEdit



Aurelio
Mar 23, 2012, 5:33 PM
Hi, it's possibile disable the editing the click or doubleclick on the row ?, actually the value of property ClicksToEdit is 2, i have test with value 0, but then double click on the row the editing appear.

Thanks
Aurelio

Daniil
Mar 23, 2012, 5:55 PM
Hi,

Do you need to disable editing for both - single click and double click?

Only "1" or "2" values are supported for ClicksToEdit.

Aurelio
Mar 23, 2012, 6:40 PM
Hi, Daniil
yes, need to disable editing for both - single click and double click.

I have the same problem with the property "ClicksToMoveEditor", open a new thread ?

Thanks

Daniil
Mar 23, 2012, 6:54 PM
I think a new thread is not required since it's a tightly related issue.

As far as I can understand you are going to start editing programmatically.

If so, I can suggest the following solution:

Example

<ext:RowEditing ID="RowEditing1" runat="server">
<Listeners>
<BeforeEdit Handler="return !this.locked;" />
</Listeners>
<CustomConfig>
<ext:ConfigItem Name="locked" Value="true" Mode="Raw" />
</CustomConfig>
</ext:RowEditing>

And you will need to unlock the RowEditing1 before starting editing.

#{RowEditing1}.locked = false;
#{RowEditing1}.startEdit(...);
#{RowEditing1}.locked = true; // to avoid moving an editor on click

Aurelio
Mar 24, 2012, 10:13 PM
HI, Daniil, work OK

Thanks
Aurelio

equiman
Sep 29, 2014, 4:13 PM
Thanks! works form me. Hard to seek on forum but finally I found here how to disabled ClicksToEdit.

I change a little this code, and now you can edit another record with mouse click(s), only if aren't editing.
Hope it help others!


<BeforeEdit Handler="
if (this.editing)
{
return !this.locked;
}
else
{
// Disbale toolbar (add / remove button)
Ext.getCmp('tbrSocios').setDisabled(true);
}" />
<CancelEdit Handler="
if (this.editing)
{
this.cancelEdit()
}

if (e.record.phantom)
{
// Send edit index (and don't take selected index)
removeRow(e.rowIdx);
}

Ext.getCmp('tbrSocios').setDisabled(false);
" />

Daniil
Sep 29, 2014, 4:46 PM
Hi @equiman,

Thank you for sharing!