2011-03-28 52 views
2

嘿, 與ext.net混淆並遇到一些小問題。ext.net /如何在行上運行服務器端方法在GridPanel中單擊?

當用戶點擊GridPanel中的一行時,我試圖運行服務器端方法。從我在互聯網上閱讀的例子來看,它應該是直接的,但它不起作用。

所以,我有(在MyTest.aspx)

<ext:GridPanel ... > 
    ... 
    <Listeners> 
     <RowClick Handler="SetCustomer"/> 
    </Listeners> 

一個GridPanel中,然後將服務器端方法(在MyTest.aspx.cs)

[DirectMethod] 
    public void SetCustomer() 
    { 
     uint customerId = 0; 
     // does nothing 
    } 

不執行SetCustomer ,但聽衆正在工作。我用的,而不是

<RowClick Handler="SetCustomer"/> 

我做

<RowClick Handler="alert('test')"/> 

檢查這個那個的作品。因此,任何想法,將不勝感激=)

回答

3
<RowClick Handler="Ext.net.DirectMethods.SetCustomer();"/> 

http://examples.ext.net/#/Events/DirectMethods/Overview/

+0

謝謝。嗯,我只是認爲這是我實際項目中的命名空間,因此我沒有使用它......嘿嘿。 – Ted 2011-03-28 12:50:59

+0

嗨有可能添加兩個RowClick處理程序? – 2016-09-13 11:16:16

相關問題