Webgrid 7 R2 rowContextMenu

5 replies. Last post: December 21, 2009 1:54 AM by Andi Santoso
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hello,

 

I get a JavaScript Error "Unknown Runtime Error" at the end of my OnRowContectMenu function.

Here is the ascx code I'm using :

<ISWebGrid:WebGrid ID="wgPostItList" runat="server" DataSourceID="idsPostItList"
              UseDefaultStyle="True" DefaultStyleMode="Elegant" Width="100%">
              <RootTable DataKeyField="PostItId" >
                  <SortedColumns>
                        <ISWebGrid:WebGridGroup ColumnMember="RecordDate" SortOrder="Ascending" />
                  </SortedColumns>
                  <Columns>
                      <ISWebGrid:WebGridColumn Caption="<%$ Resources:Resources, grdDate %>"
                            DataMember="RecordDate" Name="RecordDate">
                      </ISWebGrid:WebGridColumn>
                      <ISWebGrid:WebGridColumn Caption="<%$ Resources:Resources, grdUser %>"
                            DataMember="UserName" Name="UserName">
                      </ISWebGrid:WebGridColumn>
                      <ISWebGrid:WebGridColumn Caption="<%$ Resources:Resources, grdFileName %>"
                            DataMember="Name" Name="Name">
                      </ISWebGrid:WebGridColumn>
                      <ISWebGrid:WebGridColumn Caption="<%$ Resources:Resources, grdType %>"
                            DataMember="MimeType" Name="MimeType">
                      </ISWebGrid:WebGridColumn>
                  </Columns>
              </RootTable>
              <LayoutSettings AllowDelete="Yes" PagingMode="ClassicPaging" PagingLoadMode="Custom" AllowSorting="Yes" 
                       PromptBeforeDelete="true" HeaderClickAction="SortMulti" AllowColumnSizing="No" AllowMultipleSelection="Yes" >
                    <ClientSideEvents OnCellDblClick="OnCellDblClick" OnRowContextMenu="OnRowContextMenu" />
              </LayoutSettings>
          </ISWebGrid:WebGrid>
          
          <isdatasource:isdatasource id="idsPostItList" runat="server">
            <tables>
                <ISDataSource:ISDataSourceTable
                    SelectMethod="GetData" 
                    SelectCountMethod="GetCount" 
                    TableName="PostIts" 
                    TypeName="PostItByObjectDataProvider" 
                    EnablePaging="true">
                </ISDataSource:ISDataSourceTable>
            </tables>
        </isdatasource:isdatasource>

and the client-code :

function ShowSelectedRowDetails(controlId) {

var grid = ISGetObject(controlId);

var row = grid.GetSelectedObject().GetRowElement();


grid.AddInput("PostItId", row.keyValue);


grid.SendCustomRequest();

return true; 

}

function OnRowContextMenu(controlId, rowType, rowElement, menuObject) {

var miDetailPostIt = new WebMenuItem();

miDetailPostIt.Text = "<asp:Literal runat="server" Text="<%$ Resources:Resources, lnkViewDetails%>" />";

miDetailPostIt.Name = "ViewDetails";

miDetailPostIt.OnClick = "ViewDetailsClick";

miDetailPostIt.CustomElement = controlId;

miDetailPostIt.ImageURL = gridDetailIcon;

menuObject.Items.Add(miDetailPostIt); 

alert ('test7'); 

}

function ViewDetailsClick(menuItem) {

return ShowSelectedRowDetails(menuItem.CustomElement);

}

I can see my alert (test7) but just after that, the call of "ViewDetailsClick" seems to return this error...

The same code is used and works correcty in all our pages.

I did check my PostItId field exists in my datasource and its value correcty set.

 

Nicolas

All times are GMT -5. The time now is 5:41 PM.
Previous Next