[CLOSED] Enable/Disable drag and drop of grid panel.

  1. #1

    [CLOSED] Enable/Disable drag and drop of grid panel.

    I Followed suggestion provided in following link,

    http://forums.ext.net/showthread.php...other&p=135711

    However I got following error.

    Error: Unable to get property 'dropZone' of undefined or null reference

    <ext:Store ID="StoreDBScript" runat="server" PageSize="50">
        <Model>
            <ext:Model ID="StoreModelDBScript" runat="server" IDProperty="DBScriptId" ClientIdProperty="DBScriptId">
                <Fields>
                    <ext:ModelField Name="DBScriptId" />
                    <ext:ModelField Name="DBBuildId" />
                    <ext:ModelField Name="Name" />
                    <ext:ModelField Name="DBScriptType" Type="Int" UseNull="true"/>
                    <ext:ModelField Name="DBChangeType" Type="Int" UseNull="true"/>
                    <ext:ModelField Name="Description" />
                    <ext:ModelField Name="Reference" />
                    <ext:ModelField Name="Sequence" Type="Int"/>
                    <ext:ModelField Name="Script" />
                    <ext:ModelField Name="ChangedBy" />
                    <ext:ModelField Name="ChangedOn"/>
                </Fields>
            </ext:Model>
        </Model>
    </ext:Store>
     
    <ext:Viewport ID="ViewportDBScript" runat="server" Layout="VBoxLayout">
        <LayoutConfig>
            <ext:VBoxLayoutConfig Align="Stretch" />
        </LayoutConfig>
        <Items>
             <ext:GridPanel
                ID="DBScriptGrid"
                runat="server"
                Header="False"
                ColumnLines="True"
                Region="Center"
                EmptyText="No Records Found"
                SortableColumns="true"
                StoreID="StoreDBScript"
                Flex="3">
                <ColumnModel ID="DBScriptColumnModel" runat="server" Enabled="false">
                    <Columns>
                        <ext:Column ID="ColumnScriptName" runat="server" Flex="1" Text="Name" DataIndex="Name">
                            <Editor>
                                <ext:TextField ID="TextScriptName" runat="server">
                                </ext:TextField>
                            </Editor>
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:RowSelectionModel ID="RowSelectionModelDBScript" runat="server">
                    </ext:RowSelectionModel>
                </SelectionModel>
                <Plugins>
                    <ext:CellEditing ID="CellEditing1" runat="server" ClicksToEdit="1">
                    </ext:CellEditing>
                </Plugins>
                <View>
                    <ext:GridView ID="GridViewDBScript" runat="server">
                        <Plugins>
                            <ext:GridDragDrop PluginId="DragDropDBScript" runat="server" DragText="Drag and drop"/>
                        </Plugins>
                    </ext:GridView>
                </View>
                <TopBar>
                    <ext:Toolbar ID="ToolbarDBScript" runat="server" Height="30" Flex="1">
                        <Items>
                            <ext:Label runat="server" ID="titleDBScripts" Text="DB Scripts" Icon="ApplicationViewList" Cls="lblcss" Flex="1"/>
                            <ext:Label runat="server" ID="Label1"  Cls="lblcss" flex="1"/>
                            <ext:Button ID="btnEdit" runat="server" Text="Edit" Disabled="true" ToolTip="Edit Data">
                                <Listeners>
                                    <Enable Handler="App.DBScriptGrid.getView().getPlugin('DragDropDBScript').dropZone.lock();" />
                                    <Disable Handler="App.DBScriptGrid.getView().getPlugin('DragDropDBScript').dropZone.unlock();" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
            </ext:GridPanel>
        </Items>
    </ext:Viewport>
    Please reply. This is bit urgent.
    Last edited by geoffrey.mcgill; Mar 26, 2014 at 5:26 PM. Reason: [CLOSED]
  2. #2
    Hi @aditya,

    Maybe, you need to use "#{DBScriptGrid}" instead of "App.DBScriptGrid".
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @aditya,

    Maybe, you need to use "#{DBScriptGrid}" instead of "App.DBScriptGrid".
    "#{DBScriptGrid}" works for me. Thanks. It is resolved now.

Similar Threads

  1. [CLOSED] Enable/disable drag/drop of grid rows from one to another
    By Sowjanya in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 25, 2014, 4:53 PM
  2. Replies: 1
    Last Post: Nov 25, 2013, 12:43 PM
  3. Replies: 4
    Last Post: Jul 19, 2013, 2:16 AM
  4. [CLOSED] Enable Drag & Drop dynamically in a treepanel
    By bogc in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 12, 2012, 6:35 AM
  5. Replies: 5
    Last Post: Dec 26, 2011, 6:39 AM

Posting Permissions