Problem on passing parameter in RAW mode in CellEditing plugin

  1. #1

    Problem on passing parameter in RAW mode in CellEditing plugin

    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);
    Last edited by ArashRahimian; Jul 03, 2017 at 2:57 PM.
  2. #2
    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

    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
    2. Forum Guidelines
    Fabrício Murta
    Developer & Support Expert
  3. #3

    Problem solved

    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>
    Last edited by ArashRahimian; Jul 03, 2017 at 3:23 PM.

Similar Threads

  1. Replies: 6
    Last Post: Jan 17, 2014, 7:38 AM
  2. parameter passing problem
    By idelacruz in forum 2.x Help
    Replies: 0
    Last Post: Aug 24, 2013, 5:19 AM
  3. [CLOSED] CellEditing Plugin tab key
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 14
    Last Post: Jun 05, 2013, 7:03 AM
  4. How to passing parameter in TreeNode
    By teamsar in forum 2.x Help
    Replies: 0
    Last Post: Jan 29, 2013, 10:06 AM
  5. [CLOSED] CellEditing plugin
    By Kev in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Sep 13, 2012, 8:06 PM

Tags for this Thread

Posting Permissions