PDA

View Full Version : Problem on passing parameter in RAW mode in CellEditing plugin



ArashRahimian
Jun 10, 2017, 5:19 AM
Hi
I have a problem in my control. I have 2 controls that named ExplorerDataView and ExplorerGridPanel. ExplorerGridPanel is inherited form GridPanel. I put them on another control named Explorer that inherited from UserControl class then I put it (Explorer control) on an ASCX. When I dbl click on a row in GridPanel for editing, my editor text field will be enabled but I cannot change its text?!?!? My code is:


var columnName = new Column { Text = "نام", DataIndex = "Title", Flex = 15 };

var txt = new TextField();

txt.DirectEvents.Change.Event += Change_Event;

columnName.Editor.Add(txt);
ColumnModel.Columns.Add(columnName);


Also this part of code will not work properly and parameter must be passed in Mode = ParameterMode.Value. When I use Mode = ParameterMode.Raw my Edit_Event will not be raised!!!


var plugin = new CellEditing();

plugin.DirectEvents.Edit.ExtraParams.Add(new Parameter
{
Name = "SelectedItemId",
Value = "#{" + ID + "}.selModel.getSelection[0].get('ID')",
Mode = ParameterMode.Raw
});
plugin.DirectEvents.Edit.Event += Edit_Event;

Plugins.Add(plugin);

fabricio.murta
Jun 12, 2017, 12:58 PM
Hello @ArashRahimian,

Please provide a simplified code sample demonstrating how to reproduce the issue.

The code sample you provide should include only the minimum amount of code required to reproduce the issue. Code unrelated to the issue is to be removed. Anyone should be able to copy + paste your sample into a local Visual Studio test project and run without having to make modifications.

Tips for creating simplified code samples (http://forums.ext.net/showthread.php?61176-Tips-for-creating-simplified-code-samples)

If Exceptions or syntax errors are thrown when testing your code sample, we'll let you know so you can revise your original sample. Then we'll review again with the updated sample.

When posting your code samples in the forums, please paste that sample within [CODE] tags. The [CODE] tags will add formatting and syntax highlighting to your sample.

The following two forum posts provide many excellent tips for posting in the forums:

1. More Information Required (http://forums.ext.net/showthread.php?10205-More-Information-Required)
2. Forum Guidelines (http://forums.ext.net/showthread.php?3440-Forum-Guidelines-For-Posting-New-Topics)

ArashRahimian
Jul 03, 2017, 3:14 PM
Hi Fabricio Murta

Thanks for reply. I solved my problem. That was my mistake. For disabling Browser short keys I used this code


document.onkeydown = function(e) {

var ev = e || window.event;
if (ev.preventDefault) {
ev.preventDefault();
} else {
ev.returnValue = false;
}
};


When I changed my code to this one my problem solved.



document.onkeydown = function(e) {

var ev = e || window.event;

if (ev.ctrlKey || ev.altKey)
if (ev.preventDefault) {
ev.preventDefault();
} else {
ev.returnValue = false;
}
};


but there is another problem that I will post it in another thread too. My problem is when I use the code below in two windows that are opened in Desktop control, assigned short keys will raising button click event of the first added window not in second one.



<ext:ButtonGroup ID="ButtonGroupClipboard" runat="server" Title="Clipboard" Columns="4">
<Content>
<ext:KeyMap runat="server" Target="#{ContentPanel}">
<Binding>
<ext:KeyBinding Ctrl="True" Handler="#{ButtonCopy}.fireEvent('click');">
<Keys>
<ext:Key Code="C"/>
</Keys>
</ext:KeyBinding>
<ext:KeyBinding Ctrl="True" Handler="#{ButtonPaste}.fireEvent('click');">
<Keys>
<ext:Key Code="V"/>
</Keys>
</ext:KeyBinding>
<ext:KeyBinding Ctrl="True" Handler="#{ButtonCut}.fireEvent('click');">
<Keys>
<ext:Key Code="X"/>
</Keys>
</ext:KeyBinding>
</Binding>
</ext:KeyMap>
</Content>
<Items>
<diten:Button ID="ButtonPinTo" runat="server" Text="Pin to Quick access" OverflowText="Pin..." Scale="Large" IconAlign="Top" RowSpan="3" ToolTip="Pin folder to quick access" OnClick="ButtonPinTo_Click"/>
<diten:Button ID="ButtonCopy" runat="server" Text="Copy" Icon="PageCopy" Scale="Large" IconAlign="Top" RowSpan="3" ToolTip="Copy the selected items to clipboard (Ctrl+C)." OnClick="ButtonCopy_Click"/>
<diten:Button ID="ButtonPaste" runat="server" Text="Paste" Icon="PagePaste" Scale="Large" IconAlign="Top" RowSpan="3" ToolTip="Paste the contents of Clipboard to the curent location. (Ctrl+V)" OnClick="ButtonPaste_Click"/>
<diten:Button ID="ButtonCut" runat="server" Text="Cut" Icon="Cut" ToolTip="Move the selected items to the Clipboard. (Ctrl+X)" OnClick="ButtonCut_Click"/>
<diten:Button ID="ButtonCopyPath" runat="server" Text="Copy path" Icon="PageCopy" ToolTip="Copy the path of selected items to the Clipboard." OnClick="ButtonCopyPath_Click"/>
<diten:Button ID="ButtonPasteShorcut" runat="server" Text="Paste shorcut" Icon="PagePaste" ToolTip="Paste shortcuts to the items on the Clipboard." OnClick="ButtonPasteShorcut_Click"/>
</Items>
<Content>
</Content>
</ext:ButtonGroup>


and why the code below not works:


<diten:Button ID="ButtonCopy" runat="server" Text="Copy" Icon="PageCopy" Scale="Large" IconAlign="Top" RowSpan="3" ToolTip="Copy the selected items to clipboard (Ctrl+C)." OnClick="ButtonCopy_Click">
<KeyMap Target="#{ContentPanel}">
<Binding>
<ext:KeyBinding Ctrl="True" Handler="#{ButtonCopy}.fireEvent('click');">
<Keys>
<ext:Key Code="C"/>
</Keys>
</ext:KeyBinding>
</Binding>
</KeyMap>
</diten:Button>