While Clicking Grid panel row column JavaScript error is coming

  1. #1

    While Clicking any row in Grid Panel JavaScript error is coming

    Hi

    While clicking any of the row in Grid panel JavaScript error is coming. Below i mentioned code sample.
    Here i am calling this window in button click event.

    
    Store:
    
    <ext:Store ID="dsmenupermission" runat="server" AutoLoad="false" WarningOnDirty="false"
            GroupField="MENUDESC" ShowWarningOnFailure="false">
            <Proxy>
                <ext:HttpProxy Url="/Groups/GetGroupmenupermissionIDv2/" Timeout="6000000" />
            </Proxy>
            <UpdateProxy>
                <ext:HttpWriteProxy Url="/Groups/SavePermission/" Timeout="6000000">
                </ext:HttpWriteProxy>
            </UpdateProxy>
            <Reader>
                <ext:JsonReader IDProperty="GROUPMENUPERMISSIONID" Root="data" TotalProperty="total">
                    <Fields>
                        <ext:RecordField Name="GROUPMENUPERMISSIONID" />
                        <ext:RecordField Name="GROUPID" />
                        <ext:RecordField Name="MENUPERMISSIONID" />
                        <ext:RecordField Name="ISCHECKED" />
                        <ext:RecordField Name="CREATEDBY" />
                        <ext:RecordField Name="CREATEDDATE" />
                        <ext:RecordField Name="LASTMODIFIEDBY" />
                        <ext:RecordField Name="LASTMODIFIEDDATE" />
                        <ext:RecordField Name="MENUDESC" />
                        <ext:RecordField Name="PERMISSIONNAME" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
            <BaseParams>
                <ext:Parameter Name="dir" Value="ASC" />
                <ext:Parameter Name="sort" Value="MENUDESC" />
            </BaseParams>
            <Listeners>
                <LoadException Handler="var win = winError;win.show();" />
                <SaveException Handler="var win = winError;win.show();" />
            </Listeners>
            <SortInfo Field="MENUDESC" Direction="ASC" />
        </ext:Store>
    
    Grid Panel:
    
    <ext:Window ID="winhistorycoa" runat="server" Icon="Key" Plain="true" Maximizable="true"
            BodyBorder="false" ForceLayout="true" Layout="fit" AutoRender="false" Resizable="false"
            Title="Permissions" Width="325" Height="380" Closable="false" Hidden="true" Modal="true"
            Constrain="true">
            <Items>
                <ext:FitLayout ID="FitLayout1" runat="server">
                    <Items>
                        <ext:GridPanel runat="server" ID="grdMastercolumns" EnableDragDrop="true" AutoExpandColumn="PERMISSIONNAME"
                            StoreID="dsmenupermission">
                            <ColumnModel ID="cmdhideshow" runat="server">
                                <Columns>
                                    <ext:Column ColumnID="GROUPMENUPERMISSIONID" Header="Available Columns" DataIndex="GROUPMENUPERMISSIONID"
                                        MenuDisabled="true" Sortable="true" Groupable="false" Hideable="false" Hidden="true" />
                                    <ext:CheckColumn ColumnID="ISCHECKED" DataIndex="ISCHECKED" Editable="true" MenuDisabled="true"
                                        Width="5" Sortable="true" Groupable="false" Hideable="false">
                                    </ext:CheckColumn>
                                    <ext:Column ColumnID="MENUDESC" Header="Menu" DataIndex="MENUDESC" MenuDisabled="false"
                                        Sortable="true" Groupable="false" Hideable="false" />
                                    <ext:Column ColumnID="PERMISSIONNAME" Header="Permission" DataIndex="PERMISSIONNAME"
                                        MenuDisabled="false" Sortable="true" Groupable="false" Hideable="false" />
                                </Columns>
                            </ColumnModel>
                            <Plugins>
                                <ext:GridFilters ID="grdfilltercolumndesc" runat="server" Local="true">
                                    <Filters>
                                        <ext:StringFilter DataIndex="MENUDESC" />
                                        <ext:StringFilter DataIndex="PERMISSIONNAME" />
                                    </Filters>
                                </ext:GridFilters>
                            </Plugins>
                            <View>
                                <ext:GroupingView ID="GroupingView7" runat="server" GroupTextTpl='<span id="ColorCode-{[values.rs[0].data.ColorCode]}"></span>{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Permission" : "Permission"]})'
                                    EnableRowBody="true" ForceFit="true" EmptyText="No Menu available" HideGroupedColumn="false"
                                    StartCollapsed="true">
                                </ext:GroupingView>
                            </View>
                            <BottomBar>
                                <ext:Toolbar ID="tlbhideshow" runat="server">
                                    <Items>
                                        <ext:Hidden ID="hdgroupidper" runat="server">
                                        </ext:Hidden>
                                        <ext:ToolbarFill ID="tblfillhideshow" runat="server" />
                                        <ext:Button ID="btnhideshowsave" runat="server" Text="Apply Changes" Icon="accept"
                                            ToolTip="Click to apply your settings">
                                            <Listeners>
                                                <Click Handler="#{winModifyReason}.show();" />
                                            </Listeners>
                                        </ext:Button>
                                        <ext:Button runat="server" ID="Button17" Text="Cancel" Icon="BulletCross">
                                            <Listeners>
                                                <Click Handler="var result = 
                                                confirm('Do you want to close the window?');if (result) {#{winhistorycoa}.hide();}" />
                                            </Listeners>
                                        </ext:Button>
                                    </Items>
                                </ext:Toolbar>
                            </BottomBar>
                            <LoadMask ShowMask="true" />
                            <SaveMask ShowMask="true" />
                        </ext:GridPanel>
                    </Items>
                </ext:FitLayout>
            </Items>
        </ext:Window>

    Error Description:

    Error: sm.isSelected is not a function
    Source File: http://ibmserver2003:820/extnet/extn...xt.axd?v=36328
    Line: 5482

    Detailed Error:

    // @source data/GridDD.js

    Ext.grid.GridDragZone.override({
    getDragData : function (e) {
    var t = Ext.lib.Event.getTarget(e),
    rowIndex = this.view.findRowIndex(t);

    if (rowIndex !== false) {
    var sm = this.grid.selModel;

    // This is line error is showing
    if (!sm.isSelected(rowIndex) || e.hasModifier() || sm.keepSelectionOnClick == "always") {
    sm.handleMouseDown(this.grid, rowIndex, e);
    }

    return {
    grid : this.grid,
    ddel : this.ddel,
    rowIndex : rowIndex,
    selections : sm.getSelections()
    };
    }

    return false;
    }
    });
    If above mentioned informations not clear means please let me know.
    Thanks in advance.
    Last edited by vs.mukesh; May 27, 2011 at 5:40 AM.
  2. #2
    Hi,

    EnableDragDrop doesn't support a default selection model - CellSelectionModel.

    Please set up Row- or Checkbox- SelectionModel.
  3. #3

    [SOLVED]

    Quote Originally Posted by Daniil View Post
    Hi,

    EnableDragDrop doesn't support a default selection model - CellSelectionModel.

    Please set up Row- or Checkbox- SelectionModel.
    Hello Daniil

    Thanks for quick update.
    I just changed property like
     EnableDragDrop="false"
    in my grid panel.
    Now it is working fine.

Similar Threads

  1. Replies: 0
    Last Post: Sep 08, 2011, 9:59 AM
  2. Grid Serial no is not coming properly
    By vs.mukesh in forum 1.x Help
    Replies: 0
    Last Post: Apr 07, 2011, 10:32 AM
  3. Replies: 4
    Last Post: Aug 12, 2009, 7:59 PM
  4. [CLOSED] error when clicking a CheckMenuItem
    By alexp in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 01, 2009, 11:10 AM
  5. IE7 Update Panel javascript error with Mono
    By cristianpsg in forum Bugs
    Replies: 0
    Last Post: Apr 30, 2009, 1:27 PM

Posting Permissions