C#EXT.NET:Ro​​wExpander中文本字段的SetValue - 无法读取属性' setValue'未定义的

时间:2018-02-20 09:38:27

标签: c# extjs ext.net

我正在尝试在代码隐藏中的textfieldrowexpander事件监听器中的js中设置AfterRender的值,但我得到了

  

无法读取属性' setValue'未定义的

以下是textfield中的rowexpander

<ext:TextField runat="server" Name="notedown" FieldLabel="Note Under" ID="fnotedown">
   <Listeners>
          <AfterRender Handler="if (form.record.data.Lid != null && form.record.data.Lid != '' )
          {
             setNoteUnder_js(form.record.data.id);
          }" />

   </Listeners>
</ext:TextField>

JS:

var setNoteUnder_js = function (fieldid){
            #{DirectMethods}.setNoteUnder(fieldid,{
                success: function (result) {
                    #{fnotedown}.setValue(result); //undefined error
                }
            });
        }

代码背后的直接方法:

[DirectMethod]
public string setNoteUnder(int fieldid)
{
    DAL.CDMADataContext dc = new DAL.CDMADataContext();

    var field = (from f in dc.CFormFields
                 where f.cid == cid && f.id == fieldid
                 select f).FirstOrDefault();

    string units = null;

    if (field.Lid != null && field.Lid != "")
    {

         units = units + " Gender: " + field.text1 + " Unit: " + field.text2;

         fnotedown.SetValue(units); //undefined error

         return units;


    }
    return null;
}

0 个答案:

没有答案