[CLOSED] DirectMethod Grid Editor error

  1. #1

    [CLOSED] DirectMethod Grid Editor error

    I'm trying to set up a Editable grid using the direct method copied from the sample site.
    The only diff is that I'm using a master page. I'm getting the error attached.
    Any ideas?

    Master Page:
    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Content.master.cs" Inherits="Aksia.Intranet.Content" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
        <asp:ContentPlaceHolder ID="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body id="MasterPageBodyTag" runat="server">
        <form id="form1" runat="server">
          <ext:ResourceManager ID="ScriptManager1" runat="server"  HideInDesign="true" Theme="Access"  ScriptMode="Release" SourceFormatting="True">
        </ext:ResourceManager> 
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
            </asp:ContentPlaceHolder>
           <asp:Label runat="server" ID="lblCache" ForeColor="White" Font-Size="XX-Small" />
        </form>
    </body>
    </html>

    Code Behind
    using System;
    using Ext.Net;
    
    namespace Aksia.Intranet.Entities.AdminPages
    {
        public partial class SoeIdEditor : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
    
            [DirectMethod]
            public void AfterEdit(string id, string newValue)
            {
                try
                {
                    //    int d = new Update("WorkflowProperty").Set("FieldValue").EqualTo(newValue).Where("WorkflowPropertyId").IsEqualTo(id).Execute();
    
    
                    // Send Message...
                    X.Msg.Alert("Saved", "Information has been saved");
    
                    this.gridProperties.Store.Primary.CommitChanges();
                }
                catch ( Exception er )
                {
                    X.Msg.Alert("Error", er.ToString());
    
                }
            }
        }
    }
    .aspx code:

    <%@ Page Title="" Language="C#" MasterPageFile="~/Content.Master" AutoEventWireup="true"
        CodeBehind="SoeIdEditor.aspx.cs" Inherits="Aksia.Intranet.Entities.AdminPages.SoeIdEditor" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     
        <ext:XScript ID="XScript1" runat="server">
        <script type="text/javascript">
     
    
            var startEditing = function (e) {
                if (e.getKey() === e.ENTER) {
                    var grid = #{gridProperties},
                        record = grid.getSelectionModel().getSelected(),
                        index = grid.store.indexOf(record);
    
                    grid.startEditing(index, 1);
                } 
            };
    
            var afterEdit = function (e) {
                try {
                    /*
                    Properties of 'e' include:
                    e.grid - This grid
                    e.record - The record being edited
                    e.field - The field name being edited
                    e.value - The value being set
                    e.originalValue - The original value for the field, before the edit.
                    e.row - The grid row index
                    e.column - The grid column index
                    */
    
                    // Call DirectMethod
             
                       #{DirectMethods}.AfterEdit(e.record.data.WorkflowPropertyId,   e.value);
                }
                catch (e) {
                    alert("err" + e);
                }
            };
        </script>
        </ext:XScript>
    
       
        <ext:ResourceManagerProxy runat="server" RemoveViewState="true" ></ext:ResourceManagerProxy>
        <asp:SqlDataSource ID="DSProperties" runat="server" ConnectionString="<%$ ConnectionStrings:WarehouseConnectionString %>"
            SelectCommand="SELECT * FROM WORKFLOWPROPERTY WHERE WorkflowSoeId=@SoeId">
            <SelectParameters>
                <asp:QueryStringParameter QueryStringField="soeId" Name="SoeId" />
            </SelectParameters>
        </asp:SqlDataSource>
        <ext:GridPanel runat="server" ID="gridProperties" AutoHeight="true" TrackMouseOver="true"
            StripeRows="true">
            <Store>
                <ext:Store runat="server" ID="storeProperties" DataSourceID="DSProperties"  >
                    <Reader>
                        <ext:JsonReader IDProperty="WorkflowProperyId">
                            <Fields>
                                <ext:RecordField Name="WorkflowProperyId" Type="Int">
                                </ext:RecordField>
                                <ext:RecordField Name="FieldName" Type="String">
                                </ext:RecordField>
                                <ext:RecordField Name="FieldValue" Type="String">
                                </ext:RecordField>
                                <ext:RecordField Name="DueDate" Type="Date">
                                </ext:RecordField>
                            </Fields>
                        </ext:JsonReader>
                    </Reader>
                </ext:Store>
            </Store>
            <Listeners>
                <KeyDown Fn="startEditing" />
                <AfterEdit Fn="afterEdit" />
            </Listeners>
            <SelectionModel>
                <ext:RowSelectionModel runat="server" SingleSelect="true" />
            </SelectionModel>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column Header="FieldName" DataIndex="FieldName">
                    </ext:Column>
                    <ext:Column Header="FieldValue" DataIndex="FieldValue">
                        <Editor>
                            <ext:TextField  runat="server" />
                        </Editor>
                    </ext:Column>
                    <ext:DateColumn Header="Date" DataIndex="DueDate">
                    </ext:DateColumn>
                </Columns>
            </ColumnModel>
            <View>
                <ext:GroupingView runat="server">
                </ext:GroupingView>
            </View>
        </ext:GridPanel>
    </asp:Content>
  2. #2

    RE: [CLOSED] DirectMethod Grid Editor error

    Hi,

    Fixed. Please update from SVN

Similar Threads

  1. [CLOSED] DirectMethod in customcontrol error
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jun 22, 2012, 8:56 PM
  2. Replies: 0
    Last Post: Sep 08, 2011, 9:59 AM
  3. Replies: 2
    Last Post: Jan 14, 2011, 5:51 PM
  4. [CLOSED] Error when processing DirectMethod on TreePanel
    By ewgoforth in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 26, 2010, 8:41 AM
  5. [CLOSED] Dynamic Text Editor in grid error
    By CMA in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 18, 2009, 8:19 AM

Posting Permissions